diff --git a/packages/ink-ui-src/src/format/color.ink b/packages/ink-ui-src/src/format/color.ink index fb8f60e..71e6cee 100644 --- a/packages/ink-ui-src/src/format/color.ink +++ b/packages/ink-ui-src/src/format/color.ink @@ -1,45 +1,60 @@ + diff --git a/packages/ink-ui-src/src/format/country.ink b/packages/ink-ui-src/src/format/country.ink index c811ee8..78a006c 100644 --- a/packages/ink-ui-src/src/format/country.ink +++ b/packages/ink-ui-src/src/format/country.ink @@ -1,4 +1,7 @@ + + + + +
+ + +
+ + + + +

+ {_('Alert')} +

+ + + import Alert from '@stackpress/ink-ui/element/alert'; + + + +

{_('Props')}

+ + + {_('Name')} + {_('Type')} + {_('Required')} + {_('Notes')} + + + outline + Boolean + No + {_('Displays the alert with a white background and colored border/text')} + + + + solid + Boolean + No + {_('Displays the alert with a solid colored background (default if outline/transparent omitted)')} + + + + transparent + Boolean + No + {_('Displays the alert with a transparent background and colored border/text')} + + + + padding + Number + No + {_('Sets custom padding in pixels (default: 16)')} + + + + color + String + No + {_('Sets a custom CSS color for background (solid) or text/border (outline/transparent), e.g., "salmon", "#ff0000"')} + + + + info + Boolean + No + {_('Sets a predefined info style (blue background)')} + + + + warning + Boolean + No + {_('Sets a predefined warning style (yellow background)')} + + + + success + Boolean + No + {_('Sets a predefined success style (green background)')} + + + + error + Boolean + No + {_('Sets a predefined error style (red background)')} + + + + muted + Boolean + No + {_('Sets a predefined muted style (gray background)')} + + + + white + Boolean + No + {_('Sets a predefined white background style')} + + + + black + Boolean + No + {_('Sets a predefined black background style')} + + + + primary + Boolean + No + {_('Sets a predefined primary style (theme-defined color)')} + + + + secondary + Boolean + No + {_('Sets a predefined secondary style (theme-defined color)')} + + + + curved + Boolean + No + {_('Applies a slightly rounded border radius (4px)')} + + + + rounded + Boolean + No + {_('Applies a fully rounded border radius (8px)')} + + + + pill + Boolean + No + {_('Applies a pill-shaped border radius (9999px)')} + + + + +

+ {_('Types')} +

+ +
+ Alerts have the following predefined color types: + info, + warning, + success, + error, and + muted. +
+ + + + No Results found + + {` + + + No Results found + + `} + + + + Are you sure? + + {` + + + Are you sure? + + `} + + + + Successfully saved! + + {` + + + Successfully saved! + + `} + + + + Could not save + + {` + + + Could not save + + `} + + + + I am disabled + + {` + + + I am disabled + + `} + + +

+ {_('Custom Color')} +

+ +
+ Alerts can use custom CSS-compatible colors for the background (solid) or text/border (outline/transparent), including hex values and color names. +
+ + + + Who likes salmon? + + {` + + + Who likes salmon? + + `} + + +

+ {_('Rounded')} +

+ +
+ Alerts can be rounded in three ways: + curved (4px), + rounded (8px), + and pill (9999px). +
+ + + + No Results found + + {` + + + No Results found + + `} + + + + Are you sure? + + {` + + + Are you sure? + + `} + + + + Successfully saved! + + {` + + + Successfully saved! + + `} + + +

+ {_('Padding')} +

+ +
+ Alerts can have custom padding values in pixels. The default is 16px, but you can override it with the padding attribute. +
+ + + + Extra padded success message! + + {` + + + Extra padded success message! + + `} + + +

+ {_('Transparent')} +

+ +
+ Setting transparent removes the background color while retaining a colored border and text. +
+ + + + This is a transparent alert. + + {` + + + This is a transparent alert. + + `} + + +

+ {_('Outline')} +

+ +
+ An outline alert has a white background with a colored border and text. +
+ + + + Warning alert with outline! + + {` + + + Warning alert with outline! + + `} + + +

+ {_('Combining Props')} +

+ +
+ You can combine multiple props like outline, curved, and padding to create custom styles. +
+ + + + Curved outline with padding. + + {` + + + Curved outline with padding. + + `} + + +
+
+
+
+ + \ No newline at end of file diff --git a/packages/ink-web/src/pages/ui/components/badge.ink b/packages/ink-web/src/pages/ui/components/badge.ink new file mode 100644 index 0000000..7fd5cc8 --- /dev/null +++ b/packages/ink-web/src/pages/ui/components/badge.ink @@ -0,0 +1,303 @@ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + +

{_('Badge')}

+ + + import Badge from '@stackpress/ink-ui/element/badge'; + + + + +

{_('Props')}

+ + {_('Name')} + {_('Type')} + {_('Required')} + {_('Notes')} + + outline + Boolean + No + {_('Displays the badge with a white background and colored border/text (default: muted)')} + + + solid + Boolean + No + {_('Displays the badge with a solid colored background and white text (default: muted)')} + + + transparent + Boolean + No + {_('Displays the badge with a transparent background and colored border/text (default: muted)')} + + + padding + Number + No + {_('Sets uniform padding in pixels (default: "2px 8px")')} + + + color + String + No + {_('Sets a custom CSS color (e.g., "salmon", "#ff0000") for background (solid) or text/border (outline/transparent)')} + + + info + Boolean + No + {_('Sets a blue background (var(--info))')} + + + warning + Boolean + No + {_('Sets a yellow background (var(--warning))')} + + + success + Boolean + No + {_('Sets a green background (var(--success))')} + + + error + Boolean + No + {_('Sets a red background (var(--error))')} + + + muted + Boolean + No + {_('Sets a gray background (var(--muted))')} + + + white + Boolean + No + {_('Sets a white background (var(--white))')} + + + black + Boolean + No + {_('Sets a black background (var(--black))')} + + + primary + Boolean + No + {_('Sets a theme-defined primary color background (var(--primary))')} + + + secondary + Boolean + No + {_('Sets a theme-defined secondary color background (var(--secondary))')} + + + curved + Boolean + No + {_('Applies a 4px border radius')} + + + rounded + Boolean + No + {_('Applies a 12px border radius')} + + + pill + Boolean + No + {_('Applies a 10000px border radius for a pill shape')} + + + + +

{_('Types')}

+
+ Badges have predefined color types: info, warning, success, error, and muted. +
+
+
Info
+
+ {`Info`} +
+
Warning
+
+ {`Warning`} +
+
Success
+
+ {`Success`} +
+
Error
+
+ {`Error`} +
+
Muted
+
+ {`Muted`} + + +

{_('Custom Color')}

+
Badges support custom CSS colors for background (solid) or text/border (outline/transparent).
+
+
Salmon
+
+ {`Salmon`} +
+
Orange
+
+ {`Orange`} +
+
Transparent
+
+ {`Transparent`} + + +

{_('Rounded')}

+
Badges can have curved (4px), rounded (12px), or pill-shaped (10000px) corners.
+
+
Curved
+
+ {`Curved`} +
+
Rounded
+
+ {`Rounded`} +
+
Pill
+
+ {`Pill`} + + +

{_('Padding')}

+
Adjust padding with the padding prop (default: 2px 8px).
+
+
Padding 4
+
+ {`Padding 4`} +
+
Padding 10
+
+ {`Padding 10`} +
+
Tight
+
+ {`Tight`} + + +

{_('Combinations')}

+
Combine props and Ink utilities for custom badge styles.
+
+
Primary Outline
+
+ {`Primary Outline`} +
+
Black Pill
+
+ {`Black Pill`} +
+
Orange Italic
+
+ {`Orange Italic`} +
+
White Theme
+
+ {`White Theme`} +
+
Secondary
+
+ {`Secondary`} + + +
+
+
+
+ + \ No newline at end of file diff --git a/packages/ink-web/src/pages/ui/components/crumbs.ink b/packages/ink-web/src/pages/ui/components/crumbs.ink new file mode 100644 index 0000000..42754ca --- /dev/null +++ b/packages/ink-web/src/pages/ui/components/crumbs.ink @@ -0,0 +1,365 @@ + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + +

{_('Crumbs')}

+ + + import Crumbs from '@stackpress/ink-ui/element/crumbs'; + + + + +

{_('Props')}

+ + {_('Name')} + {_('Type')} + {_('Required')} + {_('Notes')} + + crumbs + Array + Yes + {_('Array of objects with icon, label, and href properties')} + + + link + Object + No + {_('Props to customize link color (e.g., { primary: true })')} + + + sep + Object + No + {_('Props to customize separator icon (e.g., { muted: true })')} + + + icon + Object + No + {_('Props to customize crumb icons (e.g., { size: "lg" })')} + + + size + String + No + {_('Sets font size (e.g., "md", "lg")')} + + + xs + Boolean + No + {_('Sets font size to 10px')} + + + sm + Boolean + No + {_('Sets font size to 12px')} + + + md + Boolean + No + {_('Sets font size to 14px')} + + + lg + Boolean + No + {_('Sets font size to 16px')} + + + xl + Boolean + No + {_('Sets font size to 18px')} + + + xl2 + Boolean + No + {_('Sets font size to 20px')} + + + xl3 + Boolean + No + {_('Sets font size to 22px')} + + + xl4 + Boolean + No + {_('Sets font size to 24px')} + + + xl5 + Boolean + No + {_('Sets font size to 26px')} + + + color + String + No + {_('Sets custom text color (e.g., "salmon", "#ff0000")')} + + + white + Boolean + No + {_('Sets text color to var(--white)')} + + + black + Boolean + No + {_('Sets text color to var(--black)')} + + + info + Boolean + No + {_('Sets text color to var(--info)')} + + + warning + Boolean + No + {_('Sets text color to var(--warning)')} + + + success + Boolean + No + {_('Sets text color to var(--success)')} + + + error + Boolean + No + {_('Sets text color to var(--error)')} + + + muted + Boolean + No + {_('Sets text color to var(--muted)')} + + + primary + Boolean + No + {_('Sets text color to var(--primary)')} + + + secondary + Boolean + No + {_('Sets text color to var(--secondary)')} + + + spacing + Number + No + {_('Sets separator margin in pixels (default: 0)')} + + + bold + Boolean + No + {_('Sets non-link text to bold')} + + + underline + Boolean + No + {_('Underlines links')} + + + block + Boolean + No + {_('Sets display to block (default)')} + + + inline + Boolean + No + {_('Sets display to inline')} + + + flex + Boolean + No + {_('Sets display to flex with centered items')} + + + + +

{_('Basic Usage')}

+
Basic breadcrumb navigation with icons and links.
+
+ +
+ {` + + + `} + + +

{_('Colors')}

+
Customize text, link, and separator colors.
+
+ +
+ {` + + `} +
+ +
+ {` + + `} +
+ +
+ {` + + `} + + +

{_('Sizes')}

+
Adjust font and icon sizes.
+
+ +
+ {` + + `} +
+ +
+ {` + + `} +
+ +
+ {` + + `} + + +

{_('Styles')}

+
Combine display, boldness, underlines, and spacing.
+
+ +
+ {` + + `} +
+ +
+ {` + + `} +
+ +
+ {` + + `} + + +
+
+
+
+ + \ No newline at end of file diff --git a/packages/ink-web/src/pages/ui/components/icon.ink b/packages/ink-web/src/pages/ui/components/icon.ink new file mode 100644 index 0000000..6cc1aa6 --- /dev/null +++ b/packages/ink-web/src/pages/ui/components/icon.ink @@ -0,0 +1,308 @@ + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + +

{_('Icon')}

+ + + import Icon from '@stackpress/ink-ui/element/icon'; + + + + +

{_('Props')}

+ + {_('Name')} + {_('Type')} + {_('Required')} + {_('Notes')} + + name + String + Yes + {_('Font Awesome icon name (e.g., "info-circle", "star")')} + + + solid + Boolean + No + {_('Uses solid icon style (default)')} + + + brand + Boolean + No + {_('Uses brand icon style (overrides solid)')} + + + size + String + No + {_('Sets custom font size (e.g., "md", "lg")')} + + + xs + Boolean + No + {_('Sets font size to 10px')} + + + sm + Boolean + No + {_('Sets font size to 12px')} + + + md + Boolean + No + {_('Sets font size to 14px')} + + + lg + Boolean + No + {_('Sets font size to 16px')} + + + xl + Boolean + No + {_('Sets font size to 18px')} + + + xl2 + Boolean + No + {_('Sets font size to 20px')} + + + xl3 + Boolean + No + {_('Sets font size to 22px')} + + + xl4 + Boolean + No + {_('Sets font size to 24px')} + + + xl5 + Boolean + No + {_('Sets font size to 26px')} + + + color + String + No + {_('Sets custom color (e.g., "salmon", "#ff0000")')} + + + white + Boolean + No + {_('Sets color to var(--white)')} + + + black + Boolean + No + {_('Sets color to var(--black)')} + + + info + Boolean + No + {_('Sets color to var(--info)')} + + + warning + Boolean + No + {_('Sets color to var(--warning)')} + + + success + Boolean + No + {_('Sets color to var(--success)')} + + + error + Boolean + No + {_('Sets color to var(--error)')} + + + muted + Boolean + No + {_('Sets color to var(--muted)')} + + + primary + Boolean + No + {_('Sets color to var(--primary)')} + + + secondary + Boolean + No + {_('Sets color to var(--secondary)')} + + + + +

{_('Basic Usage')}

+
Basic icons with default solid style.
+
+ + + +
+ {` + + + + `} + + +

{_('Colors')}

+
Customize icon colors with predefined or custom values.
+
+ + + + +
+ {` + + + + + `} +
+ + + +
+ {` + + + + `} + + +

{_('Sizes')}

+
Adjust icon sizes with predefined options.
+
+ + + + +
+ {` + + + + + `} + + +

{_('Types')}

+
Use solid or brand icon styles.
+
+ + + +
+ {` + + + + `} + + +
+
+
+
+ + \ No newline at end of file diff --git a/packages/ink-web/src/pages/ui/components/loader.ink b/packages/ink-web/src/pages/ui/components/loader.ink new file mode 100644 index 0000000..2a728d8 --- /dev/null +++ b/packages/ink-web/src/pages/ui/components/loader.ink @@ -0,0 +1,281 @@ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + +

{_('Loader')}

+ + + import Loader from '@stackpress/ink-ui/element/loader'; + + + + +

{_('Props')}

+ + {_('Name')} + {_('Type')} + {_('Required')} + {_('Notes')} + + size + Number + No + {_('Sets width and height in pixels (default: 20)')} + + + slice + Number + No + {_('Number of transparent sides (0-3, default: 0)')} + + + speed + Number + No + {_('Animation duration in milliseconds (default: 1000)')} + + + thickness + Number + No + {_('Border thickness in pixels (default: 2)')} + + + solid + Boolean + No + {_('Sets solid border style (default)')} + + + dotted + Boolean + No + {_('Sets dotted border style')} + + + dashed + Boolean + No + {_('Sets dashed border style')} + + + color + String + No + {_('Sets custom border color (e.g., "salmon", "#ff0000")')} + + + white + Boolean + No + {_('Sets border color to var(--white)')} + + + black + Boolean + No + {_('Sets border color to var(--black)')} + + + info + Boolean + No + {_('Sets border color to var(--info)')} + + + warning + Boolean + No + {_('Sets border color to var(--warning)')} + + + success + Boolean + No + {_('Sets border color to var(--success)')} + + + error + Boolean + No + {_('Sets border color to var(--error)')} + + + muted + Boolean + No + {_('Sets border color to var(--muted)')} + + + primary + Boolean + No + {_('Sets border color to var(--primary)')} + + + secondary + Boolean + No + {_('Sets border color to var(--secondary)')} + + + + +

{_('Basic Usage')}

+
Default loader with solid style.
+
+ +
+ {` + + `} + + +

{_('Styles')}

+
Customize border styles.
+
+ + + +
+ {` + + + + `} + + +

{_('Colors')}

+
Predefined and custom colors for loaders.
+
+ + + + +
+ {` + + + + + `} +
+ + + +
+ {` + + + + `} + + +

{_('Customizations')}

+
Combine size, thickness, slices, and speed.
+
+ + + + +
+ {` + + + + + `} +
+ + + +
+ {` + + + + `} + + +
+
+
+
+ + \ No newline at end of file diff --git a/packages/ink-web/src/pages/ui/components/notify.ink b/packages/ink-web/src/pages/ui/components/notify.ink new file mode 100644 index 0000000..965586b --- /dev/null +++ b/packages/ink-web/src/pages/ui/components/notify.ink @@ -0,0 +1,308 @@ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + +

{_('Notify')}

+ + + import Notify from '@stackpress/ink-ui/element/notify'; + + + + +

{_('Props')}

+ + {_('Name')} + {_('Type')} + {_('Required')} + {_('Notes')} + + top + Boolean + No + {_('Positions notifications 20px from the top (default: bottom 20px)')} + + + left + Boolean + No + {_('Aligns notifications 20px from the left (default: right 20px)')} + + + center + Boolean + No + {_('Centers notifications horizontally')} + + + smooth + Number + No + {_('Sets interval for opacity and progress updates in milliseconds (default: 10)')} + + + type + String + Yes (for notify) + {_('Defines notification type: "info", "warning", "error", "success", "primary", "secondary", "muted"')} + + + message + String + Yes (for notify) + {_('Sets the notification message content')} + + + timeout + Number + No (for notify) + {_('Duration in milliseconds before auto-dismissal (default: 5000)')} + + + + +

{_('Variants')}

+
Notifications support multiple variants with distinct styles and icons.
+ +
+ Show Info + Show Warning + Show Success + Show Error + Show Primary + Show Secondary + Show Muted +
+ {` + + + Show Info + + `} + + +

{_('Position')}

+
Customize notification position with top, left, or center alignment.
+ + + + +
+ Show Top + Show Left + Show Center + Show Bottom Right +
+ {` + + + Show Top + + `} + + +

{_('Timeout')}

+
Adjust how long notifications remain visible.
+ +
+ Show 8s Notification + Show 3s Notification +
+ {` + + + Show 8s Notification + + `} + + +

{_('Dismiss')}

+
Notifications include a close button for manual dismissal.
+ +
+ Show Dismissible +
+ {` + + + Show Dismissible + + `} + + +

{_('Stacked')}

+
Trigger multiple notifications to stack them vertically.
+ +
+ Show Stacked Notifications +
+ {` + + + Show Stacked Notifications + + `} + + +
+
+
+
+ + \ No newline at end of file diff --git a/packages/ink-web/src/pages/ui/components/pager.ink b/packages/ink-web/src/pages/ui/components/pager.ink new file mode 100644 index 0000000..fe9e921 --- /dev/null +++ b/packages/ink-web/src/pages/ui/components/pager.ink @@ -0,0 +1,369 @@ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + +

{_('Pager')}

+ + + import Pager from '@stackpress/ink-ui/element/pager'; + + + + +

{_('Props')}

+ + {_('Name')} + {_('Type')} + {_('Required')} + {_('Notes')} + + total + Number + No + {_('Total number of items (default: 0)')} + + + start + Number + No + {_('Starting index of current range (default: 0)')} + + + range + Number + No + {_('Items per page (default: 50)')} + + + radius + Number + No + {_('Number of pages shown before/after current page (default: 2)')} + + + next + Boolean + No + {_('Shows next page button')} + + + prev + Boolean + No + {_('Shows previous page button')} + + + rewind + Boolean + No + {_('Shows first page button')} + + + forward + Boolean + No + {_('Shows last page button')} + + + link + Object + No + {_('Sets link color (e.g., { primary: true })')} + + + control + Object + No + {_('Sets control icon props (e.g., { info: true })')} + + + border + Object + No + {_('Sets border color (e.g., { black: true })')} + + + background + Object + No + {_('Sets background color (e.g., { info: true })')} + + + square + Number + No + {_('Sets width and height in pixels for square layout (default: 0)')} + + + size + String + No + {_('Sets font size (e.g., "md", "lg")')} + + + xs + Boolean + No + {_('Sets font size to 10px')} + + + sm + Boolean + No + {_('Sets font size to 12px')} + + + md + Boolean + No + {_('Sets font size to 14px')} + + + lg + Boolean + No + {_('Sets font size to 16px')} + + + xl + Boolean + No + {_('Sets font size to 18px')} + + + xl2 + Boolean + No + {_('Sets font size to 20px')} + + + xl3 + Boolean + No + {_('Sets font size to 22px')} + + + xl4 + Boolean + No + {_('Sets font size to 24px')} + + + xl5 + Boolean + No + {_('Sets font size to 26px')} + + + color + String + No + {_('Sets text color (e.g., "salmon", "#ff0000")')} + + + white + Boolean + No + {_('Sets text color to var(--white)')} + + + black + Boolean + No + {_('Sets text color to var(--black)')} + + + info + Boolean + No + {_('Sets text color to var(--info)')} + + + warning + Boolean + No + {_('Sets text color to var(--warning)')} + + + success + Boolean + No + {_('Sets text color to var(--success)')} + + + error + Boolean + No + {_('Sets text color to var(--error)')} + + + muted + Boolean + No + {_('Sets text color to var(--muted)')} + + + primary + Boolean + No + {_('Sets text color to var(--primary)')} + + + secondary + Boolean + No + {_('Sets text color to var(--secondary)')} + + + bold + Boolean + No + {_('Makes current page number bold')} + + + underline + Boolean + No + {_('Underlines page links')} + + + page + Function + No + {_('Callback function when a page is selected (receives page number)')} + + + + +

{_('Basic Usage')}

+
Simple pagination with page numbers.
+
+ +
+ {` + + `} + + +

{_('Controls')}

+
Add navigation controls for first, previous, next, and last pages.
+
+ +
+ {` + + `} + + +

{_('Styling')}

+
Customize colors, borders, and text styles.
+
+ +
+ {` + + `} +
+ +
+ {` + + `} + + +

{_('Customizations')}

+
Combine size, radius, square layout, and callback functionality.
+
+ +
+ {` + + `} +
+ +
+ {` + + `} + + +
+
+
+
+ + \ No newline at end of file diff --git a/packages/ink-web/src/pages/ui/components/panel.ink b/packages/ink-web/src/pages/ui/components/panel.ink new file mode 100644 index 0000000..447d49a --- /dev/null +++ b/packages/ink-web/src/pages/ui/components/panel.ink @@ -0,0 +1,357 @@ + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
+ + + + + + +

+ {_(' Panel')} +

+ + + import Panel from '@stackpress/ink-ui/element/panel'; + + + +

{_('Slots')}

+ + {_('Slot')} + {_('Tag')} + {_('Required')} + {_('Notes')} + + + main + <main> + Yes + {_('Main content area (fixed between header/footer and sidebars)')} + + + + header + <header> + No + {_('Top panel, 60px height, adjusts for left sidebar')} + + + + footer + <footer> + No + {_('Bottom panel, 60px height, adjusts for left sidebar')} + + + + left + <aside left> + No + {_('Left sidebar, 226px width, toggleable')} + + + + right + <aside right> + No + {_('Right sidebar, 200px width, toggleable')} + + + + +

{_('Basic Panel Layout')}

+
{_('A simple layout with a header, left sidebar, right sidebar, and main content, using absolute positioning:')}
+ +
+
+
Header
+
+ + +
+
Main Content
+
+
+ + {` +
+
+
Header
+
+ + +
+
Main Content
+
+
+ `}
+ + +

{_('Panel Layout with Footer')}

+
{_('Extends the basic layout by adding a footer at the bottom:')}
+ +
+
+
Header
+
+ + +
+
Main Content
+
+
+
Footer
+
+
+ + {` +
+
+
Header
+
+ + +
+
Main Content
+
+
+
Footer
+
+
+ `}
+ + +

+ {_('Centered Panel Layout')} +

+ +
+ A centered layout with only a header and main content. +
+ +
+
+ +
+
Header
+
+ +
+
Main Content
+
+
+
+ + + {` +
+
+ +
+
Header
+
+ + +
+
Main Content
+
+
+
+ `}
+ + +

{_('Sticky Header & Footer')}

+
{_('A layout with a sticky header and footer, and a scrollable main content area using flexbox:')}
+ +
+
+
Sticky Header
+
+
+
+

Main Content (Scroll Down)

+

Additional content to demonstrate scrolling.

+

More content here...

+
+

End of content.

+
+
+
+
Sticky Footer
+
+
+ + {` +
+
+
Sticky Header
+
+
+
+

Main Content (Scroll Down)

+

Additional content to demonstrate scrolling.

+

More content here...

+
+

End of content.

+
+
+
+
Sticky Footer
+
+
+ `}
+ + +

{_('Responsive Panel Layout')}

+
{_('A layout that stacks on mobile and splits into columns on larger screens using flexbox and responsive utilities:')}
+ +
+
+
Header
+
+ +
+
Main Content
+
+ +
+ + {` +
+
+
Header
+
+ +
+
Main Content
+
+ +
+ `}
+ + +
+
+
+
+ + \ No newline at end of file diff --git a/packages/ink-web/src/pages/ui/components/progress.ink b/packages/ink-web/src/pages/ui/components/progress.ink new file mode 100644 index 0000000..c27e42c --- /dev/null +++ b/packages/ink-web/src/pages/ui/components/progress.ink @@ -0,0 +1,236 @@ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + +

{_('Progress')}

+ + + import Progress from '@stackpress/ink-ui/element/progress'; + + + + +

{_('Props')}

+ + {_('Name')} + {_('Type')} + {_('Required')} + {_('Notes')} + + width + Number + No + {_('Progress percentage (0-100, default: 0)')} + + + height + Number + No + {_('Height of the progress bar in pixels (default: 20)')} + + + bg + Object + No + {_('Background color of the container (e.g., { muted: true })')} + + + color + String + No + {_('Bar color (e.g., "salmon", "#ff0000")')} + + + white + Boolean + No + {_('Sets bar color to var(--white)')} + + + black + Boolean + No + {_('Sets bar color to var(--black)')} + + + info + Boolean + No + {_('Sets bar color to var(--info)')} + + + warning + Boolean + No + {_('Sets bar color to var(--warning)')} + + + success + Boolean + No + {_('Sets bar color to var(--success)')} + + + error + Boolean + No + {_('Sets bar color to var(--error)')} + + + muted + Boolean + No + {_('Sets bar color to var(--muted)')} + + + primary + Boolean + No + {_('Sets bar color to var(--primary)')} + + + secondary + Boolean + No + {_('Sets bar color to var(--secondary)')} + + + + +

{_('Basic Usage')}

+
A simple progress bar with a set width.
+
+ +
+ {` + + `} + + +

{_('Colors')}

+
Customize bar and background colors.
+
+ +
+ {` + + `} +
+ +
+ {` + + `} +
+ +
+ {` + + `} + + +

{_('Label')}

+
Add a centered label inside the progress bar.
+
+ + 50% + +
+ {` + + 50% + + `} +
+ + Loading... + +
+ {` + + Loading... + + `} + + + + +
+
+
+
+ + \ No newline at end of file diff --git a/packages/ink-web/src/pages/ui/components/tab.ink b/packages/ink-web/src/pages/ui/components/tab.ink new file mode 100644 index 0000000..429749f --- /dev/null +++ b/packages/ink-web/src/pages/ui/components/tab.ink @@ -0,0 +1,304 @@ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + +

{_('Tab')}

+ + + import Tab from '@stackpress/ink-ui/element/tab'; + + + + +

{_('Props')}

+ + {_('Name')} + {_('Type')} + {_('Required')} + {_('Notes')} + + group + String + Yes + {_('Groups tabs together; only one tab per group can be active')} + + + selector + String + Yes + {_('CSS selector for content to show/hide (e.g., "#content-id")')} + + + active + String + No + {_('Space-separated classes for active state (default: "")')} + + + inactive + String + No + {_('Space-separated classes for inactive state (default: "")')} + + + on + Boolean + No + {_('Sets tab as initially active')} + + + + +

{_('Basic Usage')}

+
Basic tab setup with content switching.
+
+
+ Tab 1 + Tab 2 +
+
Content for Tab 1
+ +
+ {` +
+ Tab 1 + Tab 2 +
+
Content for Tab 1
+ + `}
+ + +

{_('Styling')}

+
Customize active and inactive states with classes.
+
+
+ Tab 1 + Tab 2 + Tab 3 +
+
Content for Tab 1
+ + +
+ {` +
+ Tab 1 + Tab 2 + Tab 3 +
+
Content for Tab 1
+ + + `}
+ + +

{_('Multiple Groups')}

+
Use different groups to manage separate tab sets.
+
+
+
+ Group 1 - Tab 1 + Group 1 - Tab 2 +
+
Content for Group 1 - Tab 1
+ +
+
+
+ Group 2 - Tab 1 + Group 2 - Tab 2 +
+
Content for Group 2 - Tab 1
+ +
+
+ {` +
+
+ Group 1 - Tab 1 + Group 1 - Tab 2 +
+
Content for Group 1 - Tab 1
+ +
+
+
+ Group 2 - Tab 1 + Group 2 - Tab 2 +
+
Content for Group 2 - Tab 1
+ +
+ `}
+ + +
+
+
+
+ + \ No newline at end of file diff --git a/packages/ink-web/src/pages/ui/components/table.ink b/packages/ink-web/src/pages/ui/components/table.ink new file mode 100644 index 0000000..a89eb23 --- /dev/null +++ b/packages/ink-web/src/pages/ui/components/table.ink @@ -0,0 +1,477 @@ + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + +

{_('Table')}

+ + + import Table from '@stackpress/ink-ui/layout/table'; + + + + +

{_('Props')}

+ + {_('Property')} + {_('Type')} + {_('Required')} + {_('Notes')} + + top + String | Number + No + {_('Makes headers sticky at the top (e.g., "10" or "10px"). Defaults to "0".')} + + + bottom + String | Number + No + {_('Makes footers sticky at the bottom (e.g., "10" or "10px"). Defaults to "0".')} + + + left + String | Number + No + {_('Makes first column sticky on the left (e.g., "10" or "10px"). Defaults to "0".')} + + + right + String | Number + No + {_('Makes last column sticky on the right (e.g., "10" or "10px"). Defaults to "0".')} + + + head + String + No + {_('Classes for headers (e.g., "bg-primary tx-white").')} + + + body + String + No + {_('Classes for body cells (e.g., "py-12 px-10").')} + + + odd + String + No + {_('Classes for odd rows (e.g., "bg-t-0").')} + + + even + String + No + {_('Classes for even rows (e.g., "bg-t-1").')} + + + foot + String + No + {_('Classes for footers (e.g., "bg-t-2").')} + + + nowrap + Boolean + No + {_('Prevents text wrapping in cells (e.g., nowrap="").')} + + + wrap1 + Boolean + No + {_('Sets cell width to 100px (e.g., wrap1="").')} + + + wrap2 + Boolean + No + {_('Sets cell width to 200px (e.g., wrap2="").')} + + + wrap3 + Boolean + No + {_('Sets cell width to 300px (e.g., wrap3="").')} + + + wrap4 + Boolean + No + {_('Sets cell width to 400px (e.g., wrap4="").')} + + + wrap5 + Boolean + No + {_('Sets cell width to 500px (e.g., wrap5="").')} + + + + +

{_('Outline Example')}

+
{_('A simple table with alternating row colors.')}
+ + {_('Name')} + {_('Role')} + {_('Status')} + + John Doe + Developer + Active + + + Jane Smith + Designer + Pending + + + {` + + {_('Name')} + {_('Role')} + {_('Status')} + + John Doe + Developer + Active + + + Jane Smith + Designer + Pending + + + `} + + +

{_('Table with Borders')}

+
{_('A table with borders around all cells.')}
+ + {_('ID')} + {_('Name')} + {_('Age')} + + 1 + Emily Watson + 29 + + + 2 + Omar Ali + 35 + + + {` + + {_('ID')} + {_('Name')} + {_('Age')} + + 1 + Emily Watson + 29 + + + 2 + Omar Ali + 35 + + + `} + + +

{_('Striped Table')}

+
{_('A table with alternating row colors for better readability.')}
+ + {_('Product')} + {_('Category')} + {_('Price')} + + iPhone 13 + Electronics + $799 + + + Nike Sneakers + Fashion + $120 + + + {` + + {_('Product')} + {_('Category')} + {_('Price')} + + iPhone 13 + Electronics + $799 + + + Nike Sneakers + Fashion + $120 + + + `} + + +

{_('Table with Mobile Icon Header')}

+
{_('A table where the "Actions" header toggles between text and an icon based on screen size, controlled by JavaScript.')}
+ + {_('User')} + {_('Email')} + {_('Status')} + + + {_('Actions')} + + + John Doe + john@example.com + Active + + + + + + + + Mary Jane + mary@example.com + Pending + + + + + + + + {` + + + {_('User')} + {_('Email')} + {_('Status')} + + + {_('Actions')} + + + John Doe + john@example.com + Active + + + + + + + + Mary Jane + mary@example.com + Pending + + + + + + + + `} + + +

{_('Table with Sticky Footer')}

+
{_('A table with a sticky footer using the `bottom` prop.')}
+ + {_('ID')} + {_('Name')} + {_('Score')} + + 1 + Alex + 85 + + + 2 + Blake + 92 + + {_('Total')} + - + 177 + + {` + + {_('ID')} + {_('Name')} + {_('Score')} + + 1 + Alex + 85 + + + 2 + Blake + 92 + + {_('Total')} + - + 177 + + `} + + +

{_('Table with Sticky Columns')}

+
{_('A table with sticky left and right columns using `left` and `right` props.')}
+
+ + {_('ID')} + {_('First Name')} + {_('Last Name')} + {_('Email')} + {_('Status')} + + 1 + Emma + Wilson + emma@example.com + Active + + + 2 + Liam + Chen + liam@example.com + Pending + + +
+ {` +
+ + {_('ID')} + {_('First Name')} + {_('Last Name')} + {_('Email')} + {_('Status')} + + 1 + Emma + Wilson + emma@example.com + Active + + + 2 + Liam + Chen + liam@example.com + Pending + + +
+ `}
+ + +
+
+
+
+ + \ No newline at end of file diff --git a/packages/ink-web/src/pages/ui/components/tooltip.ink b/packages/ink-web/src/pages/ui/components/tooltip.ink new file mode 100644 index 0000000..32a3de9 --- /dev/null +++ b/packages/ink-web/src/pages/ui/components/tooltip.ink @@ -0,0 +1,306 @@ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + +

{_('Tooltip')}

+ + + import Tooltip from '@stackpress/ink-ui/element/tooltip'; + + + + +

{_('Props')}

+ + {_('Name')} + {_('Type')} + {_('Required')} + {_('Notes')} + + top + Boolean | Number | String + No + {_('Position from top (true = 0px, number = px, string = custom)')} + + + bottom + Boolean | Number | String + No + {_('Position from bottom (true = 0px, number = px, string = custom)')} + + + left + Boolean | Number | String + No + {_('Position from left (true = 0px, number = px, string = custom)')} + + + right + Boolean | Number | String + No + {_('Position from right (true = 0px, number = px, string = custom)')} + + + color + String + No + {_('Text color (e.g., "salmon", "#ff0000")')} + + + white + Boolean + No + {_('Sets text color to var(--white)')} + + + black + Boolean + No + {_('Sets text color to var(--black)')} + + + info + Boolean + No + {_('Sets text color to var(--info)')} + + + warning + Boolean + No + {_('Sets text color to var(--warning)')} + + + success + Boolean + No + {_('Sets text color to var(--success)')} + + + error + Boolean + No + {_('Sets text color to var(--error)')} + + + muted + Boolean + No + {_('Sets text color to var(--muted)')} + + + primary + Boolean + No + {_('Sets text color to var(--primary)')} + + + secondary + Boolean + No + {_('Sets text color to var(--secondary)')} + + + background + Object + No + {_('Background color (e.g., { info: true })')} + + + curved + Boolean + No + {_('Sets border-radius to 4px')} + + + curve + Number + No + {_('Sets custom border-radius in pixels')} + + + center + Boolean + No + {_('Centers text horizontally')} + + + padding + Number + No + {_('Sets padding in pixels')} + + + opacity + Number + No + {_('Sets opacity (0-100)')} + + + width + String | Number + No + {_('Sets width ("auto" or pixels, default: "auto")')} + + + + +

{_('Basic Usage')}

+
A simple tooltip that appears on hover.
+
+ + Hover me + Tooltip text + +
+ {` + + Hover me + Tooltip text + + `} + + +

{_('Position')}

+
Adjust tooltip position with top, bottom, left, or right.
+
+ + Top + Top Tooltip + + + Bottom + Bottom Tooltip + + + Left + Left Tooltip + + + Right + Right Tooltip + +
+ {` + + Top + Top Tooltip + + + Bottom + Bottom Tooltip + + `} + + +

{_('Styling')}

+
Customize appearance with colors, curves, padding, and more.
+
+ + Info + This is the first and last name + + + Success + Success Tooltip + + + Warning + Warning Tooltip + + + Custom Width + Custom Width Tooltip + +
+ {` + + Info + This is the first and last name + + + Success + Success Tooltip + + `} + + +
+
+
+
+ + \ No newline at end of file diff --git a/packages/ink-web/src/pages/ui/elements/alert.ink b/packages/ink-web/src/pages/ui/elements/alert.ink deleted file mode 100644 index 71e2314..0000000 --- a/packages/ink-web/src/pages/ui/elements/alert.ink +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - -
- -
- - -

- {_('Alert')} -

- - - import Alert from '@stackpress/ink-ui/element/alert'; - - -

- {_('Props')} -

- - {_('Name')} - {_('Type')} - {_('Required')} - {_('Notes')} - - solid - Boolean - No - {_('Solid layout')} - - - outline - Boolean - No - {_('Outline layout')} - - - transparent - Boolean - No - {_('Transparent layout')} - - - - - - Good News! - -
-
-
- - \ No newline at end of file diff --git a/packages/ink-web/src/pages/ui/field/checkbox.ink b/packages/ink-web/src/pages/ui/field/checkbox.ink new file mode 100644 index 0000000..29cafa9 --- /dev/null +++ b/packages/ink-web/src/pages/ui/field/checkbox.ink @@ -0,0 +1,289 @@ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + +

{_('Checkbox Field')}

+ + + import Checkbox from '@stackpress/ink-ui/field/checkbox'; + + + + +

{_('Props')}

+ + {_('Name')} + {_('Type')} + {_('Required')} + {_('Notes')} + + name + String + No + {_('Name attribute for the checkbox')} + + + label + String + No + {_('Text displayed next to the checkbox (default: "")')} + + + value + String + No + {_('Value attribute when checked')} + + + checked + Boolean + No + {_('Initial checked state')} + + + disabled + Boolean + No + {_('Disables the checkbox')} + + + readonly + Boolean + No + {_('Makes the checkbox read-only')} + + + required + Boolean + No + {_('Marks the checkbox as required')} + + + white + Boolean + No + {_('Sets checkbox color to var(--white)')} + + + black + Boolean + No + {_('Sets checkbox color to var(--black)')} + + + info + Boolean + No + {_('Sets checkbox color to var(--info)')} + + + warning + Boolean + No + {_('Sets checkbox color to var(--warning)')} + + + success + Boolean + No + {_('Sets checkbox color to var(--success)')} + + + error + Boolean + No + {_('Sets checkbox color to var(--error)')} + + + muted + Boolean + No + {_('Sets checkbox color to var(--muted)')} + + + primary + Boolean + No + {_('Sets checkbox color to var(--primary)')} + + + secondary + Boolean + No + {_('Sets checkbox color to var(--secondary)')} + + + orange + Boolean + No + {_('Sets checkbox color to orange (custom utility)')} + + + rounded + Boolean + No + {_('Sets checkbox to a rounded square shape')} + + + circle + Boolean + No + {_('Sets checkbox to a circular shape')} + + + update + Function + No + {_('Callback function on change (receives event)')} + + + click + Function + No + {_('Custom click handler')} + + + + +

{_('Basic Usage')}

+
A simple checkbox with a label.
+
+ +
+ {` + + `} + + +

{_('States')}

+
Checkbox with different states: checked, disabled, required.
+
+ + + +
+ {` + + + + `} + + +

{_('Shape')}

+
Checkbox with different shapes: default (square), rounded, circle.
+
+ + + +
+ {` + + + + `} + + +

{_('Custom Styling')}

+
Checkbox with custom color and update callback.
+
+ console.log('Checkbox changed:', e.target.checked)} + /> +
+ {` + console.log('Checkbox changed:', e.target.checked)} + /> + `} + + +
+
+
+
+ + \ No newline at end of file diff --git a/packages/ink-web/src/pages/ui/field/color.ink b/packages/ink-web/src/pages/ui/field/color.ink new file mode 100644 index 0000000..d3a605c --- /dev/null +++ b/packages/ink-web/src/pages/ui/field/color.ink @@ -0,0 +1,172 @@ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + +

{_('Color Field')}

+ + + import Color from '@stackpress/ink-ui/field/color'; + + + + +

{_('Props')}

+ + {_('Name')} + {_('Type')} + {_('Required')} + {_('Notes')} + + autocomplete + String + No + {_('Autocomplete attribute (e.g., "off")')} + + + name + String + No + {_('Name attribute for form submission')} + + + required + Boolean + No + {_('Marks the field as required')} + + + value + String + No + {_('Initial color value (e.g., "#ff69b4")')} + + + placeholder + String + No + {_('Placeholder text for the text input')} + + + + +

{_('Basic Usage')}

+
A simple color field with a placeholder.
+
+ +
+ {` + + `} + + +

{_('States')}

+
Color field with different states: value, required.
+
+ + +
+ {` + + + `} + + +

{_('Custom Styling')}

+
Color field with custom styling and initial value.
+
+ +
+ {` + + `} + + +
+
+
+
+ + \ No newline at end of file diff --git a/packages/ink-web/src/pages/ui/field/country.ink b/packages/ink-web/src/pages/ui/field/country.ink new file mode 100644 index 0000000..a82c0d9 --- /dev/null +++ b/packages/ink-web/src/pages/ui/field/country.ink @@ -0,0 +1,218 @@ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + +

{_('Country Field')}

+ + + import Country from '@stackpress/ink-ui/field/country'; + + + + +

{_('Props')}

+ + {_('Name')} + {_('Type')} + {_('Required')} + {_('Notes')} + + name + String + No + {_('Name attribute for form submission')} + + + value + String | Array + No + {_('Initial selected country code(s) (e.g., "US")')} + + + placeholder + String + No + {_('Placeholder text when no country is selected (default: "Select Country")')} + + + open + Function + No + {_('Callback when dropdown opens')} + + + close + Function + No + {_('Callback when dropdown closes')} + + + filter + Function + No + {_('Callback when search input changes')} + + + select + Function + No + {_('Callback when a country is selected')} + + + remove + Function + No + {_('Callback when a country is removed')} + + + add + Function + No + {_('Callback when add button is clicked (if enabled)')} + + + clear + Function + No + {_('Callback when clear button is clicked')} + + + change + Function + No + {_('Callback when selection changes')} + + + update + Function + No + {_('Callback for general updates')} + + + + +

{_('Basic Usage')}

+
A simple country selector with a placeholder.
+
+ +
+ {` + + `} + + +

{_('Events')}

+
Country field with event handlers for interaction logging.
+
+ console.log('open', e)} + close={(e) => console.log('close', e)} + filter={(e) => console.log('filter', e)} + select={(e) => console.log('select', e)} + remove={(e) => console.log('remove', e)} + add={(e) => console.log('add', e)} + clear={(e) => console.log('clear', e)} + change={(e) => console.log('change', e)} + update={(e) => console.log('update', e)} + /> +
+ {` + console.log('open', e)} + close={(e) => console.log('close', e)} + filter={(e) => console.log('filter', e)} + select={(e) => console.log('select', e)} + remove={(e) => console.log('remove', e)} + add={(e) => console.log('add', e)} + clear={(e) => console.log('clear', e)} + change={(e) => console.log('change', e)} + update={(e) => console.log('update', e)} + /> + `} + + + +
+
+
+
+ + \ No newline at end of file diff --git a/packages/ink-web/src/pages/ui/field/currency.ink b/packages/ink-web/src/pages/ui/field/currency.ink new file mode 100644 index 0000000..71f6bd3 --- /dev/null +++ b/packages/ink-web/src/pages/ui/field/currency.ink @@ -0,0 +1,143 @@ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + +

{_('Currency Field')}

+ + + import Currency from '@stackpress/ink-ui/field/currency'; + + + + +

{_('Props')}

+ + {_('Name')} + {_('Type')} + {_('Required')} + {_('Notes')} + + name + String + No + {_('Name attribute for form submission')} + + + value + String + No + {_('Initial currency code (e.g., "PHP")')} + + + placeholder + String + No + {_('Text when no currency is selected (default: "Select Currency")')} + + + class + String + No + {_('Custom CSS classes for styling (e.g., "w-200")')} + + + + +

{_('Basic Usage')}

+
A simple currency dropdown.
+
+ +
+ {` + + `} + + +

{_('Initial Value')}

+
Currency field with an initial value.
+
+ +
+ {` + + `} + + +
+
+
+
+ + \ No newline at end of file diff --git a/packages/ink-web/src/pages/ui/field/date.ink b/packages/ink-web/src/pages/ui/field/date.ink new file mode 100644 index 0000000..cf674b5 --- /dev/null +++ b/packages/ink-web/src/pages/ui/field/date.ink @@ -0,0 +1,206 @@ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + +

{_('Date Field')}

+ + + import Date from '@stackpress/ink-ui/field/date'; + + + + +

{_('Props')}

+ + {_('Name')} + {_('Type')} + {_('Required')} + {_('Notes')} + + autocomplete + String + No + {_('Autocomplete attribute (e.g., "off")')} + + + disabled + Boolean + No + {_('Disables the date picker')} + + + name + String + No + {_('Name attribute for form submission')} + + + pattern + String + No + {_('Regex pattern for validation (e.g., "[0-9]{4}-[0-9]{2}-[0-9]{2}")')} + + + readonly + Boolean + No + {_('Makes the date picker read-only')} + + + required + Boolean + No + {_('Marks the field as required')} + + + value + String | Date + No + {_('Initial date value (e.g., "2020-01-01" or Date object), converted to YYYY-MM-DD')} + + + placeholder + String + No + {_('Placeholder text for the date input')} + + + change + Function + No + {_('Callback for change event (receives ChangeEvent)')} + + + update + Function + No + {_('Callback with formatted date string (YYYY-MM-DD)')} + + + + +

{_('Basic Usage')}

+
A simple date field with a placeholder.
+
+ +
+ {` + + `} + + +

{_('States')}

+
Date field with different states: value, disabled, required.
+
+ + + +
+ {` + + + + `} + + +

{_('Custom Styling')}

+
Date field with custom styling, initial value, and update callback.
+
+ console.log('Updated date:', date)} + class="rounded b-solid b-primary p-5 w-200" + /> +
+ {` + console.log('Updated date:', date)} + class="rounded b-solid b-primary p-5 w-200" + /> + `} + + +
+
+
+
+ + \ No newline at end of file diff --git a/packages/ink-web/src/pages/ui/field/datetime.ink b/packages/ink-web/src/pages/ui/field/datetime.ink new file mode 100644 index 0000000..70c39ec --- /dev/null +++ b/packages/ink-web/src/pages/ui/field/datetime.ink @@ -0,0 +1,206 @@ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + +

{_('Datetime Field')}

+ + + import Datetime from '@stackpress/ink-ui/field/datetime'; + + + + +

{_('Props')}

+ + {_('Name')} + {_('Type')} + {_('Required')} + {_('Notes')} + + autocomplete + String + No + {_('Autocomplete attribute (e.g., "off")')} + + + disabled + Boolean + No + {_('Disables the datetime picker')} + + + name + String + No + {_('Name attribute for form submission')} + + + pattern + String + No + {_('Regex pattern for validation (e.g., "[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}")')} + + + readonly + Boolean + No + {_('Makes the datetime picker read-only')} + + + required + Boolean + No + {_('Marks the field as required')} + + + value + String | Date + No + {_('Initial datetime value (e.g., "2020-01-01T13:20:10" or Date object), converted to ISO without Z')} + + + placeholder + String + No + {_('Placeholder text for the datetime input')} + + + change + Function + No + {_('Callback for change event (receives ChangeEvent)')} + + + update + Function + No + {_('Callback with formatted datetime string (e.g., "2020-01-01T13:20:10")')} + + + + +

{_('Basic Usage')}

+
A simple datetime field with a placeholder.
+
+ +
+ {` + + `} + + +

{_('States')}

+
Datetime field with different states: value, disabled, required.
+
+ + + +
+ {` + + + + `} + + +

{_('Custom Styling')}

+
Datetime field with custom styling, initial value, and update callback.
+
+ console.log('Updated datetime:', datetime)} + class="rounded b-solid b-primary p-5 w-250" + /> +
+ {` + console.log('Updated datetime:', datetime)} + class="rounded b-solid b-primary p-5 w-250" + /> + `} + + +
+
+
+
+ + \ No newline at end of file diff --git a/packages/ink-web/src/pages/ui/field/editor.ink b/packages/ink-web/src/pages/ui/field/editor.ink new file mode 100644 index 0000000..70f3803 --- /dev/null +++ b/packages/ink-web/src/pages/ui/field/editor.ink @@ -0,0 +1,184 @@ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + +

{_('Editor Field')}

+ + + import Editor from '@stackpress/ink-ui/field/editor'; + + + + +

{_('Props')}

+ + {_('Name')} + {_('Type')} + {_('Required')} + {_('Notes')} + + lang + String + No + {_('CodeMirror mode (e.g., "javascript", "htmlmixed", "markdown", default: "htmlmixed")')} + + + numbers + Boolean + No + {_('Show line numbers (default: false)')} + + + name + String + No + {_('Name attribute for form submission')} + + + value + String + No + {_('Initial code content')} + + + change + Function + No + {_('Callback for change event (receives ChangeEvent)')} + + + update + Function + No + {_('Callback with updated code string')} + + + + +

{_('Basic Usage')}

+
A simple editor field with default HTML mode.
+
+ +
+ {` + + `} + + +

{_('Languages')}

+
Editor field with different languages and line numbers.
+
+ + + +
+ {` + + + + `} + + +

{_('Custom Styling')}

+
Editor field with custom styling, JavaScript mode, and update callback.
+
+ console.log('Updated code:', value)} + /> +
+ {` + console.log('Updated code:', value)} + /> + `} + + +
+
+
+
+ + \ No newline at end of file diff --git a/packages/ink-web/src/pages/ui/field/file.ink b/packages/ink-web/src/pages/ui/field/file.ink new file mode 100644 index 0000000..bdc2d46 --- /dev/null +++ b/packages/ink-web/src/pages/ui/field/file.ink @@ -0,0 +1,218 @@ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + +

{_('File Field')}

+ + + import File from '@stackpress/ink-ui/field/file'; + + + + +

{_('Props')}

+ + {_('Name')} + {_('Type')} + {_('Required')} + {_('Notes')} + + name + String + No + {_('Name attribute for form submission')} + + + value + String + No + {_('Initial file URL')} + + + image + Boolean + No + {_('Restricts to images and shows preview')} + + + uploading + String + No + {_('Text during upload (default: "Uploading...")')} + + + upload + Function + No + {_('Upload handler (file, next) => void; next receives URL')} + + + change + Function + No + {_('Callback for change event (receives ChangeEvent)')} + + + update + Function + No + {_('Callback with uploaded file URL')} + + + + +

{_('Basic Usage')}

+
A simple file field without upload handling.
+
+ +
+ {` + + `} + + +

{_('Image Preview')}

+
File field with image restriction and preview.
+
+ +
+ {` + + `} + + + +

{_('Image Mode')}

+
File field restricted to images with preview.
+
+ +
+ {` + + `} + + +

{_('Custom Upload')}

+
File field with custom upload function and update callback.
+
+ console.log('Uploaded URL:', url)} + /> +
+ {` + + console.log('Uploaded URL:', url)} + /> + `} + + +
+
+
+
+ + \ No newline at end of file diff --git a/packages/ink-web/src/pages/ui/field/filelist.ink b/packages/ink-web/src/pages/ui/field/filelist.ink new file mode 100644 index 0000000..c17fbdc --- /dev/null +++ b/packages/ink-web/src/pages/ui/field/filelist.ink @@ -0,0 +1,236 @@ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + +

{_('Filelist Field')}

+ + + import Filelist from '@stackpress/ink-ui/field/filelist'; + + + + +

{_('Props')}

+ + {_('Name')} + {_('Type')} + {_('Required')} + {_('Notes')} + + name + String + No + {_('Name attribute for form submission')} + + + value + Array + No + {_('Initial array of file URLs (default: [])')} + + + image + Boolean + No + {_('Restricts to images and shows previews')} + + + uploading + String + No + {_('Text during upload (default: "Uploading...")')} + + + upload + Function + No + {_('Upload handler (files, next) => void; next receives URL array')} + + + change + Function + No + {_('Callback for change event (receives ChangeEvent)')} + + + update + Function + No + {_('Callback with updated URL array (not implemented in source)')} + + + + +

{_('Basic Usage')}

+
A simple filelist field without upload handling.
+
+ +
+ {` + + `} + + +

{_('Image Mode')}

+
Filelist field restricted to images, showing previews of uploaded files after a mock upload (uses a static URL for demo; replace upload function for real URLs).
+
+ +
+ {` + + + `} + + +

{_('Default Values')}

+
Filelist field with preloaded image URLs and removal options.
+
+ +
+ {` + + `} + + +

{_('Custom Upload')}

+
Filelist field with custom upload function and update callback.
+
+ console.log('Uploaded URLs:', urls)} + /> +
+ {` + + console.log('Uploaded URLs:', urls)} + /> + `} + + +
+
+
+
+ + \ No newline at end of file diff --git a/packages/ink-web/src/pages/ui/field/input.ink b/packages/ink-web/src/pages/ui/field/input.ink new file mode 100644 index 0000000..8c183d8 --- /dev/null +++ b/packages/ink-web/src/pages/ui/field/input.ink @@ -0,0 +1,256 @@ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + +

{_('Input Field')}

+ + + import Input from '@stackpress/ink-ui/field/input'; + + + + +

{_('Props')}

+ + {_('Name')} + {_('Type')} + {_('Required')} + {_('Notes')} + + accept + String + No + {_('File types for file input (e.g., "image/*")')} + + + autocomplete + String + No + {_('Autocomplete attribute (e.g., "on", "off")')} + + + checked + Boolean + No + {_('Initial checked state for checkbox/radio')} + + + disabled + Boolean + No + {_('Disables the input')} + + + max + String | Number + No + {_('Maximum value for number/range inputs')} + + + min + String | Number + No + {_('Minimum value for number/range inputs')} + + + multiple + Boolean + No + {_('Allows multiple values (e.g., for file inputs)')} + + + name + String + No + {_('Name attribute for form submission')} + + + pattern + String + No + {_('Regex pattern for validation (e.g., "[A-Za-z]+")')} + + + placeholder + String + No + {_('Placeholder text')} + + + readonly + Boolean + No + {_('Makes the input read-only')} + + + required + Boolean + No + {_('Marks the input as required')} + + + step + String | Number + No + {_('Step increment for number/range inputs')} + + + type + String + No + {_('Input type (e.g., "text", "email", "number", default: "text")')} + + + value + String + No + {_('Initial value')} + + + change + Function + No + {_('Callback for change event')} + + + update + Function + No + {_('Callback for value updates')} + + + + +

{_('Basic Usage')}

+
A simple text input with placeholder and initial value.
+
+ +
+ {` + + `} + + +

{_('States')}

+
Input field with different states: disabled, required, readonly.
+
+ + + +
+ {` + + + + `} + + +

{_('Custom Styling')}

+
Input field with custom styling and change callback.
+
+ console.log('Changed to:', e.target.value)} + /> +
+ {` + console.log('Changed to:', e.target.value)} + /> + `} + + +
+
+
+
+ + \ No newline at end of file diff --git a/packages/ink-web/src/pages/ui/field/markdown.ink b/packages/ink-web/src/pages/ui/field/markdown.ink new file mode 100644 index 0000000..e363208 --- /dev/null +++ b/packages/ink-web/src/pages/ui/field/markdown.ink @@ -0,0 +1,190 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + +

{_('Markdown Field')}

+ + + import Markdown from '@stackpress/ink-ui/field/markdown'; + + + + +

{_('Props')}

+ + {_('Name')} + {_('Type')} + {_('Required')} + {_('Notes')} + + name + String + No + {_('Name attribute for form submission')} + + + value + String + No + {_('Initial markdown content')} + + + numbers + Boolean + No + {_('Show line numbers in editor (default: false)')} + + + change + Function + No + {_('Callback for change event (receives ChangeEvent)')} + + + update + Function + No + {_('Callback with updated markdown string')} + + + + +

{_('Basic Usage')}

+
A simple markdown editor with initial content.
+
+ +
+ {` + + `} + + +

{_('Preview Mode')}

+
Markdown field with preview toggle (hover to see buttons).
+
+ +
+ {` + + `} + + +

{_('Custom Styling')}

+
Markdown field with custom styling, line numbers, and update callback.
+
+ console.log('Updated markdown:', value)} + /> +
+ {` + console.log('Updated markdown:', value)} + /> + `} + + +
+
+
+
+ + \ No newline at end of file diff --git a/packages/ink-web/src/pages/ui/field/mask.ink b/packages/ink-web/src/pages/ui/field/mask.ink new file mode 100644 index 0000000..491c5cd --- /dev/null +++ b/packages/ink-web/src/pages/ui/field/mask.ink @@ -0,0 +1,350 @@ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + +

{_('Mask Field')}

+ + + import Mask from '@stackpress/ink-ui/field/mask'; + + + + +

{_('Props')}

+ + {_('Name')} + {_('Type')} + {_('Required')} + {_('Notes')} + + autocomplete + String + No + {_('Autocomplete attribute (e.g., "on", "off")')} + + + disabled + Boolean + No + {_('Disables the input')} + + + name + String + No + {_('Name attribute for form submission')} + + + pattern + String + No + {_('Regex pattern for validation')} + + + readonly + Boolean + No + {_('Makes the input read-only')} + + + required + Boolean + No + {_('Marks the input as required')} + + + value + String + No + {_('Initial value')} + + + mask + String + No + {_('Mask pattern (e.g., "999-999-9999")')} + + + regex + String + No + {_('Regex pattern for mask (alternative to mask)')} + + + alias + String + No + {_('Predefined mask alias (e.g., "phone", "email")')} + + + repeat + Number + No + {_('Number of times to repeat mask')} + + + greedy + Boolean + No + {_('Greedy masking behavior')} + + + numericInput + Boolean + No + {_('Forces numeric input')} + + + rightAlign + Boolean + No + {_('Aligns input to the right')} + + + definitions + Object + No + {_('Custom mask definitions')} + + + change + Function + No + {_('Callback for change event')} + + + update + Function + No + {_('Callback for value updates')} + + + + +

{_('Basic Usage')}

+
A simple masked input for a phone number.
+
+ +
+ {` + + `} + + +

{_('Custom Mask')}

+
Masked input with a custom date format and numeric input.
+
+ +
+ {` + + `} + + +

{_('Alias Mask')}

+
Masked input using a predefined alias for email.
+
+ +
+ {` + + `} + + +

{_('Numeric Input')}

+
Masked input restricted to numbers with a disabled state.
+
+ +
+ {` + + `} + + +

{_('Right Alignment')}

+
Masked input aligned to the right with a currency mask.
+
+ +
+ {` + + `} + + +

{_('Repeated Mask')}

+
Masked input with a repeating pattern and greedy behavior.
+
+ +
+ {` + + `} + + +

{_('Styling')}

+
Masked input with custom styling and change callback.
+
+ console.log('Changed to:', e.target.value)} + /> +
+ {` + console.log('Changed to:', e.target.value)} + /> + `} + + +
+
+
+
+ + \ No newline at end of file diff --git a/packages/ink-web/src/pages/ui/field/metadata.ink b/packages/ink-web/src/pages/ui/field/metadata.ink new file mode 100644 index 0000000..a0136e9 --- /dev/null +++ b/packages/ink-web/src/pages/ui/field/metadata.ink @@ -0,0 +1,181 @@ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + +

{_('Metadata Field')}

+ + + import Metadata from '@stackpress/ink-ui/field/metadata'; + + + + +

{_('Props')}

+ + {_('Name')} + {_('Type')} + {_('Required')} + {_('Notes')} + + name + String + No + {_('Base name for form submission (e.g., "metadata[key]")')} + + + value + Object + No + {_('Initial key-value pairs (default: {})')} + + + add + String + No + {_('Text for the add button (default: "Add")')} + + + + +

{_('Basic Usage')}

+
A simple metadata field with default add button.
+
+ +
+ {` + + `} + + +

{_('Initial Values')}

+
Metadata field with preloaded key-value pairs.
+
+ +
+ {` + + `} + + +

{_('Custom Styling')}

+
Metadata field with custom styling, placeholder, and update callback.
+
+ console.log('Updated metadata:', value)} + /> +
+ {` + + console.log('Updated metadata:', value)} + /> + `} + + +
+
+
+
+ + \ No newline at end of file diff --git a/packages/ink-web/src/pages/ui/field/number.ink b/packages/ink-web/src/pages/ui/field/number.ink new file mode 100644 index 0000000..a82bfc8 --- /dev/null +++ b/packages/ink-web/src/pages/ui/field/number.ink @@ -0,0 +1,292 @@ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + +

{_('Number Field')}

+ + + import Number from '@stackpress/ink-ui/field/number'; + + + + +

{_('Props')}

+ + {_('Name')} + {_('Type')} + {_('Required')} + {_('Notes')} + + autocomplete + String + No + {_('Autocomplete attribute (e.g., "on", "off")')} + + + disabled + Boolean + No + {_('Disables the input')} + + + max + String | Number + No + {_('Maximum value')} + + + min + String | Number + No + {_('Minimum value')} + + + name + String + No + {_('Name attribute for form submission')} + + + pattern + String + No + {_('Regex pattern for validation')} + + + placeholder + String + No + {_('Placeholder text')} + + + readonly + Boolean + No + {_('Makes the input read-only')} + + + required + Boolean + No + {_('Marks the input as required')} + + + step + String | Number + No + {_('Step increment (determines decimal places)')} + + + type + String + No + {_('Input type (default: "text", not "number")')} + + + value + String + No + {_('Initial value')} + + + separator + String + No + {_('Thousands separator (default: ",")')} + + + decimal + String + No + {_('Decimal point character (default: ".")')} + + + absolute + Boolean + No + {_('Forces positive values (default: false)')} + + + background + String + No + {_('Background color (default: "var(--white)")')} + + + border + String + No + {_('Border color (default: "var(--black)")')} + + + change + Function + No + {_('Callback for change event')} + + + update + Function + No + {_('Callback with numeric value as string')} + + + + +

{_('Basic Usage')}

+
A simple number input with constraints.
+
+ +
+ {` + + `} + + +

{_('Formatting Options')}

+
Number field with custom separator and decimal formatting.
+
+ +
+ {` + + `} + + +

{_('Custom Styling')}

+
Number field with custom styling and update callback.
+
+ console.log('Updated to:', value)} + /> +
+ {` + console.log('Updated to:', value)} + /> + `} + + +
+
+
+
+ + \ No newline at end of file diff --git a/packages/ink-web/src/pages/ui/field/password.ink b/packages/ink-web/src/pages/ui/field/password.ink new file mode 100644 index 0000000..887c18e --- /dev/null +++ b/packages/ink-web/src/pages/ui/field/password.ink @@ -0,0 +1,208 @@ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + +

{_('Password Field')}

+ + + import Password from '@stackpress/ink-ui/field/password'; + + + + +

{_('Props')}

+ + {_('Name')} + {_('Type')} + {_('Required')} + {_('Notes')} + + autocomplete + String + No + {_('Autocomplete attribute (e.g., "new-password")')} + + + disabled + Boolean + No + {_('Disables the input')} + + + name + String + No + {_('Name attribute for form submission')} + + + pattern + String + No + {_('Regex pattern for validation')} + + + readonly + Boolean + No + {_('Makes the input read-only')} + + + required + Boolean + No + {_('Marks the input as required')} + + + value + String + No + {_('Initial password value')} + + + change + Function + No + {_('Callback for change event')} + + + update + Function + No + {_('Callback with updated value')} + + + + +

{_('Basic Usage')}

+
A simple password input with placeholder.
+
+ +
+ {` + + `} + + +

{_('Visibility Toggle')}

+
Password field with initial value and toggle visibility.
+
+ +
+ {` + + `} + + +

{_('Custom Styling')}

+
Password field with custom styling and update callback.
+
+ console.log('Updated to:', value)} + /> +
+ {` + console.log('Updated to:', value)} + /> + `} + + +
+
+
+
+ + \ No newline at end of file diff --git a/packages/ink-web/src/pages/ui/field/radio.ink b/packages/ink-web/src/pages/ui/field/radio.ink new file mode 100644 index 0000000..cef5fcc --- /dev/null +++ b/packages/ink-web/src/pages/ui/field/radio.ink @@ -0,0 +1,338 @@ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + +

{_('Radio Field')}

+ + + import Radio from '@stackpress/ink-ui/field/radio'; + + + + +

{_('Props')}

+ + {_('Name')} + {_('Type')} + {_('Required')} + {_('Notes')} + + checked + Boolean + No + {_('Initial checked state')} + + + disabled + Boolean + No + {_('Disables the radio')} + + + name + String + No + {_('Name attribute for form submission and grouping')} + + + readonly + Boolean + No + {_('Prevents changing the radio state')} + + + required + Boolean + No + {_('Marks the radio group as required in a form')} + + + value + String + No + {_('Value of the radio option')} + + + label + String + No + {_('Text label for the radio (default: "")')} + + + change + Function + No + {_('Callback for change event')} + + + update + Function + No + {_('Callback with updated value')} + + + + +

{_('Simple Radio')}

+
A basic radio button with a square shape.
+
+ +
+ {` + + `} + + +

{_('Styled Group')}

+
A group of radio buttons with rounded shapes, spacing, and update callback.
+
+ console.log('Selected:', value)} + /> + console.log('Selected:', value)} + /> +
+ {` + console.log('Selected:', value)} + /> + console.log('Selected:', value)} + /> + `} + + +

{_('Disabled and Readonly')}

+
Radio buttons demonstrating disabled and readonly states.
+
+ + + +
+ {` + + + + `} + + +

{_('Required Group')}

+
A group of radio buttons marked as required.
+
+ + +
+ {` + + + `} + + +

{_('Styled Radio Button')}

+
A styled radio group with custom class and style props, including hover effects.
+
+ + +
+ {` + + + `} + + +
+
+
+
+ + \ No newline at end of file diff --git a/packages/ink-web/src/pages/ui/field/range.ink b/packages/ink-web/src/pages/ui/field/range.ink new file mode 100644 index 0000000..24cb6d0 --- /dev/null +++ b/packages/ink-web/src/pages/ui/field/range.ink @@ -0,0 +1,275 @@ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + +

{_('Range Field')}

+ + + import Range from '@stackpress/ink-ui/field/range'; + + + + +

{_('Props')}

+ + {_('Name')} + {_('Type')} + {_('Required')} + {_('Notes')} + + autocomplete + String + No + {_('Autocomplete attribute (e.g., "off")')} + + + disabled + Boolean + No + {_('Disables both inputs')} + + + name + String + No + {_('Name attribute for form submission')} + + + readonly + Boolean + No + {_('Makes both inputs read-only')} + + + required + Boolean + No + {_('Marks the input as required')} + + + value + String | Number + No + {_('Initial value')} + + + min + String | Number + No + {_('Minimum value (default: 0)')} + + + max + String | Number + No + {_('Maximum value (default: 100)')} + + + step + String | Number + No + {_('Step increment (default: 1)')} + + + width + String | Number + No + {_('Width of the number input in pixels (default: 60)')} + + + + +

{_('Basic Usage')}

+
A basic range slider with default settings.
+
+ +
+ {` + + `} + + +

{_('Custom Range')}

+
Range slider with custom min, max, step, and wider number input.
+
+ +
+ {` + + `} + + +

{_('Disabled State')}

+
Range slider in disabled and readonly states.
+
+ + +
+ {` + + + `} + + +

{_('Styled Range')}

+
Range slider with custom styling and required attribute.
+
+ +
+ {` + + `} + + +
+
+
+
+ + \ No newline at end of file diff --git a/packages/ink-web/src/pages/ui/field/rating.ink b/packages/ink-web/src/pages/ui/field/rating.ink new file mode 100644 index 0000000..7c08cd4 --- /dev/null +++ b/packages/ink-web/src/pages/ui/field/rating.ink @@ -0,0 +1,236 @@ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + +

{_('Rating')}

+ + + import Rating from '@stackpress/ink-ui/field/rating'; + + + + + +

{_('Props')}

+ + {_('Property')} + {_('Type')} + {_('Required')} + {_('Description')} + + + name + String + No + {_('Name attribute for form submission.')} + + + + value + String/Number + No + {_('Initial rating value (defaults to 0).')} + + + + max + String/Number + No + {_('Maximum number of stars (defaults to 5).')} + + + + disabled + Boolean + No + {_('Disables the rating input.')} + + + + required + Boolean + No + {_('Marks the input as required.')} + + + + change + Function + No + {_('Custom handler for change events, receiving the selected value.')} + + + + update + Function + No + {_('Callback with the updated rating value.')} + + + + class + String + No + {_('CSS classes for the host element (use Ink utilities).')} + + + + style + String + No + {_('Inline styles (prefer Ink utilities instead).')} + + + + + +

{_('Basic Rating Input')}

+
{_('A basic rating input with 5 stars.')}
+
+
+ +
+
+ {` + + `} + + + +

{_('Rating with Custom Max')}

+
{_('A rating input with a custom maximum number of stars.')}
+
+
+ +
+
+ {` + + `} + + + +

{_('Styled Rating Input')}

+
{_('A styled rating input with custom size, color, and hover effects using Ink utilities.')}
+
+
+ +
+
+ {` + + `} + + + +
+
+
+
+ + \ No newline at end of file diff --git a/packages/ink-web/src/pages/ui/field/select.ink b/packages/ink-web/src/pages/ui/field/select.ink new file mode 100644 index 0000000..4ebeada --- /dev/null +++ b/packages/ink-web/src/pages/ui/field/select.ink @@ -0,0 +1,334 @@ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + +

{_('Select Field')}

+ + + import Select from '@stackpress/ink-ui/field/select'; + + + + +

{_('Props')}

+ + {_('Name')} + {_('Type')} + {_('Required')} + {_('Notes')} + + name + String + No + {_('Name attribute for form submission')} + + + value + String | Array + No + {_('Initial value(s); string for single, array for multiple')} + + + placeholder + String + No + {_('Text when no option is selected (default: "Choose Option")')} + + + custom + Boolean + No + {_('Enables adding custom options via input')} + + + search + Boolean + No + {_('Enables search filtering of options')} + + + multiple + Boolean + No + {_('Allows multiple selections (assumed supported)')} + + + open + Function + No + {_('Callback when dropdown opens')} + + + close + Function + No + {_('Callback when dropdown closes')} + + + filter + Function + No + {_('Callback on search input change')} + + + select + Function + No + {_('Callback when an option is selected')} + + + remove + Function + No + {_('Callback when an option is removed')} + + + add + Function + No + {_('Callback when a custom option is added')} + + + clear + Function + No + {_('Callback when selections are cleared')} + + + change + Function + No + {_('Callback on selection change')} + + + update + Function + No + {_('Callback with updated value(s)')} + + + class + String + No + {_('Custom CSS classes for the host element')} + + + + +

{_('Basic Usage')}

+
A simple single-select dropdown with options.
+
+ + + + + +
+ {` + + + + + + `} + + +

{_('With Search')}

+
A select field with search and multiple selection.
+
+ console.log('Filter:', e.target.value)} + > + + + + + +
+ {` + console.log('Filter:', e.target.value)} + > + + + + + + `} + + +

{_('Enhanced Features')}

+
A select field with search, custom input, multiple selection, and event handlers.
+
+ console.log('Open:', e)} + close={(e) => console.log('Close:', e)} + filter={(e) => console.log('Filter:', e)} + select={(e) => console.log('Select:', e)} + remove={(e) => console.log('Remove:', e)} + add={(e) => console.log('Add:', e)} + clear={(e) => console.log('Clear:', e)} + change={(e) => console.log('Change:', e)} + update={(e) => console.log('Update:', e)} + > + + + + + +
+ {` + console.log('Open:', e)} + close={(e) => console.log('Close:', e)} + filter={(e) => console.log('Filter:', e)} + select={(e) => console.log('Select:', e)} + remove={(e) => console.log('Remove:', e)} + add={(e) => console.log('Add:', e)} + clear={(e) => console.log('Clear:', e)} + change={(e) => console.log('Change:', e)} + update={(e) => console.log('Update:', e)} + > + + + + + + `} + + + +

{_('Styled Select Input')}

+
{_('A styled select input with custom options, styling, and hover effects using Ink utilities.')}
+
+
+ + + + + +
+
+ {` + + + + + + `} + + +
+
+
+
+ + \ No newline at end of file diff --git a/packages/ink-web/src/pages/ui/field/slug.ink b/packages/ink-web/src/pages/ui/field/slug.ink new file mode 100644 index 0000000..267101b --- /dev/null +++ b/packages/ink-web/src/pages/ui/field/slug.ink @@ -0,0 +1,241 @@ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + +

{_('Slug Field')}

+ + + import Slug from '@stackpress/ink-ui/field/slug'; + + + + +

{_('Props')}

+ + {_('Name')} + {_('Type')} + {_('Required')} + {_('Notes')} + + autocomplete + String + No + {_('Autocomplete attribute (e.g., "off")')} + + + disabled + Boolean + No + {_('Disables the input')} + + + name + String + No + {_('Name attribute for form submission')} + + + pattern + String + No + {_('Regex pattern for input validation')} + + + readonly + Boolean + No + {_('Makes the input read-only')} + + + required + Boolean + No + {_('Marks the input as required')} + + + value + String + No + {_('Initial value, transformed to slug format')} + + + dash + Boolean + No + {_('Uses dashes instead of underscores in slugs')} + + + line + Boolean + No + {_('Preserves underscores in slugs')} + + + camel + Boolean + No + {_('Transforms to camelCase instead of slug format')} + + + change + Function + No + {_('Callback on input change event')} + + + update + Function + No + {_('Callback with transformed slug value')} + + + placeholder + String + No + {_('Placeholder text for the input')} + + + + +

{_('Basic Usage')}

+
A simple slug field with a placeholder.
+
+ +
+ {` + + `} + + +

{_('States')}

+
Slug field with different states.
+
+ + + +
+ {` + + + + `} + + +

{_('Slug Formats')}

+
Slug field with different transformation formats: dash, line, and camel.
+
+ + + +
+ {` + + + + `} + + +

{_('Custom Styling')}

+
Slug field with custom styling, initial value, and update callback.
+
+ console.log('Slug updated:', value)} + /> +
+ {` + console.log('Slug updated:', value)} + /> + `} + + +
+
+
+
+ + \ No newline at end of file diff --git a/packages/ink-web/src/pages/ui/field/switch.ink b/packages/ink-web/src/pages/ui/field/switch.ink new file mode 100644 index 0000000..0abd913 --- /dev/null +++ b/packages/ink-web/src/pages/ui/field/switch.ink @@ -0,0 +1,293 @@ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + +

{_('Switch Field')}

+ + + import Switch from '@stackpress/ink-ui/field/switch'; + + + + +

{_('Props')}

+ + {_('Name')} + {_('Type')} + {_('Required')} + {_('Notes')} + + checked + Boolean + No + {_('Sets the switch to checked state initially.')} + + + disabled + Boolean + No + {_('Disables the switch.')} + + + name + String + No + {_('Name attribute for form submission.')} + + + readonly + Boolean + No + {_('Makes the switch read-only.')} + + + required + Boolean + No + {_('Marks the switch as required in a form.')} + + + value + String + No + {_('Value submitted when checked.')} + + + label + String + No + {_('Text displayed next to the switch. Defaults to empty string.')} + + + change + Function + No + {_('Callback triggered on switch change event.')} + + + update + Function + No + {_('Callback triggered with the switch value on change.')} + + + onoff + Boolean + No + {_('Displays "ON" and "OFF" in the switch.')} + + + yesno + Boolean + No + {_('Displays "YES" and "NO" in the switch.')} + + + checkex + Boolean + No + {_('Displays check (✓) and cross (✖) symbols in the switch.')} + + + sunmoon + Boolean + No + {_('Displays sun (☼) and moon (☽) symbols in the switch.')} + + + rounded + Boolean + No + {_('Rounds the switch track and thumb.')} + + + ridge + Boolean + No + {_('Adds ridges ("|||") to the switch thumb.')} + + + smooth + Boolean + No + {_('Makes the switch thumb smooth (no content).')} + + + blue + Boolean + No + {_('Applies a blue color scheme to the switch.')} + + + orange + Boolean + No + {_('Applies an orange color scheme to the switch.')} + + + green + Boolean + No + {_('Applies a green color scheme to the switch.')} + + + error + Boolean + No + {_('Indicates an error state (not styled by default).')} + + + + +

{_('Basic Usage')}

+
{_('A simple switch with a label and default styling.')}
+
+ +
+ {` + + `} + + +

{_('States')}

+
{_('Switch field with different states.')}
+
+ + + +
+ {` + + + + `} + + +

{_('Styles')}

+
{_('Switch field with different styling options.')}
+
+ + + +
+ {` + + + + `} + + +

{_('Variations')}

+
{_('Switch field with different text/symbols and colors.')}
+
+ + + + + console.log('Switch updated:', value)} + /> +
+ {` + + + + + console.log('Switch updated:', value)} + /> + `} + + +
+
+
+
+ + \ No newline at end of file diff --git a/packages/ink-web/src/pages/ui/field/taglist.ink b/packages/ink-web/src/pages/ui/field/taglist.ink new file mode 100644 index 0000000..c5539b8 --- /dev/null +++ b/packages/ink-web/src/pages/ui/field/taglist.ink @@ -0,0 +1,249 @@ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + +

{_('Taglist Field')}

+ + + import Taglist from '@stackpress/ink-ui/field/taglist'; + + + + +

{_('Props')}

+ + {_('Name')} + {_('Type')} + {_('Required')} + {_('Notes')} + + name + String + No + {_('Name attribute for hidden inputs, used in form submission.')} + + + value + Array | String + No + {_('Initial tags. Can be an array or comma-separated string. Defaults to empty array.')} + + + placeholder + String + No + {_('Placeholder text for the input field.')} + + + change + Function + No + {_('Callback triggered on input change event.')} + + + update + Function + No + {_('Callback triggered with updated tag list on add/remove.')} + + + info + Boolean + No + {_('Sets tag background to info color (e.g., blue).')} + + + warning + Boolean + No + {_('Sets tag background to warning color (default: yellow).')} + + + success + Boolean + No + {_('Sets tag background to success color (e.g., green).')} + + + error + Boolean + No + {_('Sets tag background to error color (e.g., red).')} + + + muted + Boolean + No + {_('Sets tag background to muted color (e.g., gray).')} + + + primary + Boolean + No + {_('Sets tag background to primary color (e.g., blue).')} + + + secondary + Boolean + No + {_('Sets tag background to secondary color (e.g., gray).')} + + + color + String + No + {_('Custom background color for tags (e.g., "#FF0000"). Overrides other color props.')} + + + class + String + No + {_('Custom CSS classes for the taglist container (e.g., "w-250").')} + + + + +

{_('Basic Usage')}

+
{_('A simple taglist with initial values and a placeholder.')}
+
+ +
+ {` + + `} + + +

{_('States')}

+
{_('Taglist with different initial states.')}
+
+ + + +
+ {` + + + + `} + + +

{_('Color Variations')}

+
{_('Taglist with different background colors for tags.')}
+
+ + + + +
+ {` + + + + + `} + + +

{_('Custom Styling')}

+
{_('Taglist with custom width, initial values, and update callback.')}
+
+ console.log('Tags updated:', tags)} + /> +
+ {` + console.log('Tags updated:', tags)} + /> + `} + + +
+
+
+
+ + \ No newline at end of file diff --git a/packages/ink-web/src/pages/ui/field/textarea.ink b/packages/ink-web/src/pages/ui/field/textarea.ink new file mode 100644 index 0000000..05e7b05 --- /dev/null +++ b/packages/ink-web/src/pages/ui/field/textarea.ink @@ -0,0 +1,200 @@ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + +

{_('Textarea Field')}

+ + + import Textarea from '@stackpress/ink-ui/field/textarea'; + + + + +

{_('Props')}

+ + {_('Name')} + {_('Type')} + {_('Required')} + {_('Notes')} + + disabled + Boolean + No + {_('Disables the textarea.')} + + + name + String + No + {_('Name attribute for form submission.')} + + + placeholder + String + No + {_('Placeholder text displayed in the textarea.')} + + + readonly + Boolean + No + {_('Makes the textarea read-only.')} + + + required + Boolean + No + {_('Marks the textarea as required in a form.')} + + + rows + Number + No + {_('Number of visible text rows.')} + + + change + Function + No + {_('Callback triggered on textarea change event.')} + + + update + Function + No + {_('Callback triggered with the textarea value on change.')} + + + class + String + No + {_('Custom CSS classes for styling (e.g., "w-300 h-100").')} + + + + +

{_('Basic Usage')}

+
{_('A simple textarea with initial content and a placeholder.')}
+
+ Some Text +
+ {` + Some Text + `} + + +

{_('States')}

+
{_('Textarea field with different states.')}
+
+ Can't edit + Read me + Must fill +
+ {` + Can't edit + Read me + Must fill + `} + + +

{_('Custom Styling')}

+
{_('Textarea with custom size, rows, and update callback.')}
+
+ console.log('Textarea updated:', value)} + >Some Text +
+ {` + console.log('Textarea updated:', value)} + >Some Text + `} + + +
+
+
+
+ + \ No newline at end of file diff --git a/packages/ink-web/src/pages/ui/field/textlist.ink b/packages/ink-web/src/pages/ui/field/textlist.ink new file mode 100644 index 0000000..056b2f1 --- /dev/null +++ b/packages/ink-web/src/pages/ui/field/textlist.ink @@ -0,0 +1,178 @@ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + +

{_('Textlist Field')}

+ + + import Textlist from '@stackpress/ink-ui/field/textlist'; + + + + +

{_('Props')}

+ + {_('Name')} + {_('Type')} + {_('Required')} + {_('Notes')} + + name + String + No + {_('Name attribute for text inputs, typically with "[]" for array submission (e.g., "textlist[]").')} + + + value + Array + No + {_('Initial list of text values. Defaults to empty array.')} + + + add + String + No + {_('Text for the add button. Defaults to "Add".')} + + + update + Function + No + {_('Callback triggered with updated list values (not implemented in source).')} + + + class + String + No + {_('Custom CSS classes for the textlist container (e.g., "w-300").')} + + + + +

{_('Basic Usage')}

+
{_('A simple textlist with initial values and a placeholder.')}
+
+ +
+ {` + + `} + + +

{_('States')}

+
{_('Textlist field with different initial states.')}
+
+ + + +
+ {` + + + + `} + + +

{_('Custom Styling')}

+
{_('Textlist with custom width, button text, and update callback.')}
+
+ console.log('Textlist updated:', values)} + /> +
+ {` + console.log('Textlist updated:', values)} + /> + `} + + +
+
+
+
+ + \ No newline at end of file diff --git a/packages/ink-web/src/pages/ui/field/time.ink b/packages/ink-web/src/pages/ui/field/time.ink new file mode 100644 index 0000000..adb99d5 --- /dev/null +++ b/packages/ink-web/src/pages/ui/field/time.ink @@ -0,0 +1,212 @@ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + +

{_('Time Field')}

+ + + import Time from '@stackpress/ink-ui/field/time'; + + + + +

{_('Props')}

+ + {_('Name')} + {_('Type')} + {_('Required')} + {_('Notes')} + + autocomplete + String + No + {_('Controls browser autocomplete behavior (e.g., "off").')} + + + disabled + Boolean + No + {_('Disables the time input.')} + + + name + String + No + {_('Name attribute for form submission.')} + + + pattern + String + No + {_('Regular expression pattern for input validation (e.g., "[0-2][0-9]:[0-5][0-9]").')} + + + placeholder + String + No + {_('Placeholder text displayed in the time input.')} + + + readonly + Boolean + No + {_('Makes the time input read-only.')} + + + required + Boolean + No + {_('Marks the time input as required in a form.')} + + + value + String | Number | Date + No + {_('Initial time value. Accepts timestamp, Date object, or ISO string; formatted as HH:MM.')} + + + change + Function + No + {_('Callback triggered on time input change event.')} + + + update + Function + No + {_('Callback triggered with the time value on change.')} + + + class + String + No + {_('Custom CSS classes for styling (e.g., "w-200").')} + + + + +

{_('Basic Usage')}

+
{_('A simple time input with a placeholder and current time.')}
+
+ +
+ {` + + `} + + +

{_('States')}

+
{_('Time field with different states.')}
+
+ + + +
+ {` + + + + `} + + +

{_('Custom Styling')}

+
{_('Time field with custom width, initial value, and update callback.')}
+
+ console.log('Time updated:', value)} + /> +
+ {` + console.log('Time updated:', value)} + /> + `} + + +
+
+
+
+ + \ No newline at end of file diff --git a/packages/ink-web/src/pages/ui/field/wysiwyg.ink b/packages/ink-web/src/pages/ui/field/wysiwyg.ink new file mode 100644 index 0000000..dcf8fa3 --- /dev/null +++ b/packages/ink-web/src/pages/ui/field/wysiwyg.ink @@ -0,0 +1,529 @@ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + +

{_('WYSIWYG')}

+

{_('The `` component is a rich text editor built with SunEditor, offering customizable toolbar options and responsive styling via Ink utilities.')}

+ + + import WYSIWYG from '@stackpress/ink-ui/field/wysiwyg'; + + + + + +

{_('Props')}

+

{_('Customize the editor’s toolbar and behavior with the props below. Use the `class` prop with Ink utilities for responsive styling.')}

+ + {_('Property')} + {_('Type')} + {_('Required')} + {_('Description')} + + + value + String + No + {_('Initial content of the editor (defaults to "").')} + + + + name + String + No + {_('Name attribute for the underlying `