@enonic/ui 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +119 -0
- package/dist/enonic-ui.cjs +27 -0
- package/dist/enonic-ui.es.js +3420 -0
- package/dist/style.css +1 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/lib/utils.d.ts +2 -0
- package/dist/types/types.d.ts +7 -0
- package/dist/types/ui/button/button.d.ts +22 -0
- package/dist/types/ui/button/index.d.ts +1 -0
- package/dist/types/ui/icon-button/icon-button.d.ts +17 -0
- package/dist/types/ui/icon-button/index.d.ts +1 -0
- package/dist/types/ui/input/index.d.ts +1 -0
- package/dist/types/ui/input/input.d.ts +39 -0
- package/package.json +171 -0
package/dist/style.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*! tailwindcss v4.1.11 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-space-y-reverse:0;--tw-border-style:solid;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-duration:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-blue-500:oklch(62.3% .214 259.815);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-900:oklch(21% .034 264.665);--color-black:#000;--color-white:#fff;--spacing:.25rem;--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--font-weight-medium:500;--font-weight-semibold:600;--radius-sm:.25rem;--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--color-main:var(--color-main);--color-subtle:var(--color-subtle);--color-alt:var(--color-alt);--color-rev:var(--color-rev);--color-surface-primary:var(--color-surface-primary);--color-info:var(--color-info);--color-info-subtle:var(--color-info-subtle);--color-info-surface:var(--color-info-surface);--color-warn:var(--color-warn);--color-warn-subtle:var(--color-warn-subtle);--color-warn-surface:var(--color-warn-surface);--color-success:var(--color-success);--color-success-subtle:var(--color-success-subtle);--color-success-surface:var(--color-success-surface);--color-danger:var(--color-danger);--color-danger-subtle:var(--color-danger-subtle);--color-danger-surface:var(--color-danger-surface);--color-bdr-subtle:var(--color-bdr-subtle);--color-bdr-soft:var(--color-bdr-soft);--color-bdr-strong:var(--color-bdr-strong);--color-bdr-danger:var(--color-bdr-danger);--color-ring:var(--color-ring);--color-btn-primary:var(--color-btn-primary);--color-btn-primary-hover:var(--color-btn-primary-hover);--color-btn-secondary:var(--color-btn-secondary);--color-btn-secondary-hover:var(--color-btn-secondary-hover);--color-btn-tertiary:var(--color-btn-tertiary);--color-btn-tertiary-hover:var(--color-btn-tertiary-hover);--color-btn-active:var(--color-btn-active);--color-input-disabled:var(--color-input-disabled);--color-doc-only:var(--color-doc-only)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}:root{--color-black:#000;--color-grey-950:#242829;--color-grey-900:#3d4142;--color-grey-800:#5b5f60;--color-grey-700:#797d7e;--color-grey-600:#8d9192;--color-grey-500:#b2b2b2;--color-grey-400:#b5b9ba;--color-grey-300:#d3d7d8;--color-grey-200:#dde1e2;--color-grey-100:#e7ebeb;--color-grey-50:#f1f5f6;--color-white:#fff;--color-info:#0270a0;--color-info-subtle:#208ebe;--color-info-surface:#d7f3ff;--color-warn:#cb9126;--color-warn-subtle:#e9af44;--color-warn-surface:#f7e5c4;--color-success:#499349;--color-success-subtle:#67b167;--color-success-surface:#cee2ce;--color-danger:#d33030;--color-danger-subtle:#f56262;--color-danger-surface:#f6d7d7;--color-juke:#9747ff;--color-main:var(--color-black);--color-subtle:var(--color-grey-800);--color-alt:var(--color-white);--color-rev:var(--color-white);--color-surface-primary:var(--color-grey-50);--color-bdr-subtle:var(--color-grey-500);--color-bdr-soft:var(--color-grey-200);--color-bdr-strong:var(--color-black);--color-bdr-danger:var(--color-danger);--color-ring:var(--color-grey-500);--color-btn-primary:var(--color-white);--color-btn-primary-hover:var(--color-grey-50);--color-btn-secondary:var(--color-grey-50);--color-btn-secondary-hover:var(--color-grey-100);--color-btn-tertiary:var(--color-black);--color-btn-tertiary-hover:var(--color-grey-900);--color-btn-active:var(--color-grey-800);--color-input-disabled:var(--color-grey-100);--color-docs:var(--color-juke);font-size:16px}.dark{--color-main:var(--color-white);--color-subtle:var(--color-grey-200);--color-alt:var(--color-grey-950);--color-rev:var(--color-black);--color-surface-primary:var(--color-grey-900);--color-bdr-subtle:var(--color-grey-500);--color-bdr-soft:var(--color-grey-800);--color-bdr-strong:var(--color-white);--color-bdr-danger:var(--color-danger-sub);--color-ring:var(--color-grey-500);--color-btn-primary:var(--color-grey-950);--color-btn-primary-hover:var(--color-grey-900);--color-btn-secondary:var(--color-grey-900);--color-btn-secondary-hover:var(--color-grey-800);--color-btn-tertiary:var(--color-grey-600);--color-btn-tertiary-hover:var(--color-grey-700);--color-btn-active:var(--color-grey-800);--color-input-disabled:var(--color-grey-800);--color-doc-only:var(--color-juke)}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.relative{position:relative}.static{position:static}.mt-1{margin-top:calc(var(--spacing)*1)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.mb-3{margin-bottom:calc(var(--spacing)*3)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.box-border{box-sizing:border-box}.block{display:block}.flex{display:flex}.grid{display:grid}.inline{display:inline}.inline-flex{display:inline-flex}.table{display:table}.h-9{height:calc(var(--spacing)*9)}.h-10{height:calc(var(--spacing)*10)}.h-11\.5{height:calc(var(--spacing)*11.5)}.min-h-10{min-height:calc(var(--spacing)*10)}.w-9{width:calc(var(--spacing)*9)}.w-10{width:calc(var(--spacing)*10)}.w-11\.5{width:calc(var(--spacing)*11.5)}.w-80{width:calc(var(--spacing)*80)}.w-96{width:calc(var(--spacing)*96)}.w-full{width:100%}.min-w-10{min-width:calc(var(--spacing)*10)}.flex-1{flex:1}.shrink-0{flex-shrink:0}.cursor-pointer{cursor:pointer}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-center{justify-content:center}.gap-1{gap:calc(var(--spacing)*1)}.gap-2{gap:calc(var(--spacing)*2)}.gap-2\.5{gap:calc(var(--spacing)*2.5)}.gap-3{gap:calc(var(--spacing)*3)}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*4)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*6)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*6)*calc(1 - var(--tw-space-y-reverse)))}.overflow-hidden{overflow:hidden}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-sm{border-radius:var(--radius-sm)}.rounded-l-none{border-top-left-radius:0;border-bottom-left-radius:0}.rounded-r-none{border-top-right-radius:0;border-bottom-right-radius:0}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-bdr-danger{border-color:var(--color-bdr-danger)}.border-bdr-strong{border-color:var(--color-bdr-strong)}.border-bdr-subtle{border-color:var(--color-bdr-subtle)}.bg-alt{background-color:var(--color-alt)}.bg-blue-500{background-color:var(--color-blue-500)}.bg-btn-primary{background-color:var(--color-btn-primary)}.bg-btn-secondary{background-color:var(--color-btn-secondary)}.bg-btn-tertiary{background-color:var(--color-btn-tertiary)}.bg-gray-200{background-color:var(--color-gray-200)}.bg-surface-primary{background-color:var(--color-surface-primary)}.p-0{padding:calc(var(--spacing)*0)}.p-4{padding:calc(var(--spacing)*4)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-3\.5{padding-inline:calc(var(--spacing)*3.5)}.px-4{padding-inline:calc(var(--spacing)*4)}.py-2{padding-block:calc(var(--spacing)*2)}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.text-danger{color:var(--color-danger)}.text-gray-900{color:var(--color-gray-900)}.text-main{color:var(--color-main)}.text-rev{color:var(--color-rev)}.text-subtle{color:var(--color-subtle)}.text-white{color:var(--color-white)}.opacity-30{opacity:.3}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.duration-100{--tw-duration:.1s;transition-duration:.1s}.placeholder\:text-subtle::placeholder{color:var(--color-subtle)}.first\:rounded-l-sm:first-child{border-top-left-radius:var(--radius-sm);border-bottom-left-radius:var(--radius-sm)}.first\:border-r:first-child{border-right-style:var(--tw-border-style);border-right-width:1px}.first\:border-bdr-soft:first-child{border-color:var(--color-bdr-soft)}.last\:rounded-r-sm:last-child{border-top-right-radius:var(--radius-sm);border-bottom-right-radius:var(--radius-sm)}.last\:border-l:last-child{border-left-style:var(--tw-border-style);border-left-width:1px}.last\:border-bdr-soft:last-child{border-color:var(--color-bdr-soft)}.read-only\:bg-surface-primary:read-only{background-color:var(--color-surface-primary)}.focus-within\:border-bdr-danger:focus-within{border-color:var(--color-bdr-danger)}.focus-within\:border-bdr-strong:focus-within{border-color:var(--color-bdr-strong)}.focus-within\:ring-3:focus-within{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(3px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-within\:ring-danger\/50:focus-within{--tw-ring-color:var(--color-danger)}@supports (color:color-mix(in lab,red,red)){.focus-within\:ring-danger\/50:focus-within{--tw-ring-color:color-mix(in oklab,var(--color-danger)50%,transparent)}}.focus-within\:ring-ring\/50:focus-within{--tw-ring-color:var(--color-ring)}@supports (color:color-mix(in lab,red,red)){.focus-within\:ring-ring\/50:focus-within{--tw-ring-color:color-mix(in oklab,var(--color-ring)50%,transparent)}}.focus-within\:ring-offset-0:focus-within{--tw-ring-offset-width:0px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus-within\:outline-none:focus-within{--tw-outline-style:none;outline-style:none}@media (hover:hover){.hover\:bg-btn-primary-hover:hover{background-color:var(--color-btn-primary-hover)}.hover\:bg-btn-secondary-hover:hover{background-color:var(--color-btn-secondary-hover)}.hover\:bg-btn-tertiary-hover:hover{background-color:var(--color-btn-tertiary-hover)}}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\:ring-3:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(3px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color:var(--color-ring)}@supports (color:color-mix(in lab,red,red)){.focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color:color-mix(in oklab,var(--color-ring)50%,transparent)}}.focus-visible\:ring-offset-0:focus-visible{--tw-ring-offset-width:0px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus-visible\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.active\:bg-btn-active:active{background-color:var(--color-btn-active)}.active\:text-rev:active{color:var(--color-rev)}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:opacity-30:disabled{opacity:.3}.dark\:text-main:where(.dark,.dark *),.dark\:active\:text-main:where(.dark,.dark *):active{color:var(--color-main)}}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-duration{syntax:"*";inherits:false}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { LucideIcon as LucideIconPreact } from 'lucide-preact';
|
|
2
|
+
import { LucideIcon as LucideIconReact } from 'lucide-react';
|
|
3
|
+
/**
|
|
4
|
+
* Unified LucideIcon type that accepts icons from both lucide-react and lucide-preact.
|
|
5
|
+
* This allows the UI library to work seamlessly with both React and Preact projects.
|
|
6
|
+
*/
|
|
7
|
+
export type LucideIcon = LucideIconPreact | LucideIconReact;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { LucideIcon } from '../../types';
|
|
2
|
+
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
import { JSX } from 'react';
|
|
4
|
+
declare const buttonVariants: (props?: ({
|
|
5
|
+
variant?: "text" | "filled" | "solid" | "outline" | null | undefined;
|
|
6
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
7
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
8
|
+
export type ButtonVariant = VariantProps<typeof buttonVariants>['variant'];
|
|
9
|
+
export type ButtonSize = VariantProps<typeof buttonVariants>['size'];
|
|
10
|
+
export type ButtonProps = {
|
|
11
|
+
className?: string;
|
|
12
|
+
variant?: ButtonVariant;
|
|
13
|
+
size?: ButtonSize;
|
|
14
|
+
startIcon?: LucideIcon;
|
|
15
|
+
label: string;
|
|
16
|
+
endIcon?: LucideIcon;
|
|
17
|
+
title?: string;
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
onClick?: () => void;
|
|
20
|
+
};
|
|
21
|
+
export declare function Button({ className, variant, size, startIcon, label, endIcon, title, disabled, onClick, }: ButtonProps): JSX.Element;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Button, type ButtonProps, type ButtonSize, type ButtonVariant } from './button';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { LucideIcon } from '../../types';
|
|
2
|
+
import { ButtonSize, ButtonVariant } from '../button';
|
|
3
|
+
import { JSX } from 'react';
|
|
4
|
+
export type IconButtonVariant = ButtonVariant;
|
|
5
|
+
export type IconButtonSize = ButtonSize;
|
|
6
|
+
export type IconButtonShape = 'square' | 'round';
|
|
7
|
+
export type IconButtonProps = {
|
|
8
|
+
className?: string;
|
|
9
|
+
variant?: IconButtonVariant;
|
|
10
|
+
size?: IconButtonSize;
|
|
11
|
+
shape?: IconButtonShape;
|
|
12
|
+
icon: LucideIcon;
|
|
13
|
+
title?: string;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
onClick?: () => void;
|
|
16
|
+
};
|
|
17
|
+
export declare function IconButton({ className, variant, size, shape, icon, title, disabled, onClick, }: IconButtonProps): JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { IconButton, type IconButtonProps } from './icon-button';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Input, type InputProps } from './input';
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { JSX } from 'react';
|
|
2
|
+
export type InputProps = {
|
|
3
|
+
className?: string;
|
|
4
|
+
label?: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
placeholder?: string;
|
|
7
|
+
error?: string;
|
|
8
|
+
startAddon?: string | JSX.Element;
|
|
9
|
+
endAddon?: string | JSX.Element;
|
|
10
|
+
value?: string;
|
|
11
|
+
defaultValue?: string;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
readOnly?: boolean;
|
|
14
|
+
onChange?: (event: Event & {
|
|
15
|
+
currentTarget: HTMLInputElement;
|
|
16
|
+
}) => void;
|
|
17
|
+
onInput?: (event: Event & {
|
|
18
|
+
currentTarget: HTMLInputElement;
|
|
19
|
+
}) => void;
|
|
20
|
+
onFocus?: (event: FocusEvent & {
|
|
21
|
+
currentTarget: HTMLInputElement;
|
|
22
|
+
}) => void;
|
|
23
|
+
onBlur?: (event: FocusEvent & {
|
|
24
|
+
currentTarget: HTMLInputElement;
|
|
25
|
+
}) => void;
|
|
26
|
+
type?: 'text' | 'password' | 'email' | 'number' | 'tel' | 'url' | 'search';
|
|
27
|
+
name?: string;
|
|
28
|
+
id?: string;
|
|
29
|
+
required?: boolean;
|
|
30
|
+
minLength?: number;
|
|
31
|
+
maxLength?: number;
|
|
32
|
+
min?: number;
|
|
33
|
+
max?: number;
|
|
34
|
+
step?: number;
|
|
35
|
+
pattern?: string;
|
|
36
|
+
autoComplete?: string;
|
|
37
|
+
tabIndex?: number;
|
|
38
|
+
};
|
|
39
|
+
export declare function Input({ className, label, description, placeholder, error, startAddon, endAddon, value, defaultValue, disabled, readOnly, onChange, onInput, onFocus, onBlur, type, name, id, required, minLength, maxLength, min, max, step, pattern, autoComplete, tabIndex, }: InputProps): JSX.Element;
|
package/package.json
ADDED
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@enonic/ui",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Enonic UI Component Library",
|
|
5
|
+
"author": "Enonic",
|
|
6
|
+
"license": "Apache-2.0",
|
|
7
|
+
"homepage": "https://github.com/enonic/npm-enonic-ui#readme",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/enonic/npm-enonic-ui.git"
|
|
11
|
+
},
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/enonic/npm-enonic-ui/issues"
|
|
14
|
+
},
|
|
15
|
+
"keywords": [
|
|
16
|
+
"enonic",
|
|
17
|
+
"ui",
|
|
18
|
+
"components",
|
|
19
|
+
"preact",
|
|
20
|
+
"react",
|
|
21
|
+
"typescript",
|
|
22
|
+
"tailwind"
|
|
23
|
+
],
|
|
24
|
+
"type": "module",
|
|
25
|
+
"main": "dist/enonic-ui.cjs",
|
|
26
|
+
"module": "dist/enonic-ui.es.js",
|
|
27
|
+
"types": "dist/types/index.d.ts",
|
|
28
|
+
"files": [
|
|
29
|
+
"dist/types/",
|
|
30
|
+
"dist/enonic-ui.es.js",
|
|
31
|
+
"dist/enonic-ui.cjs",
|
|
32
|
+
"dist/style.css"
|
|
33
|
+
],
|
|
34
|
+
"exports": {
|
|
35
|
+
".": {
|
|
36
|
+
"types": "./dist/types/index.d.ts",
|
|
37
|
+
"import": "./dist/enonic-ui.es.js",
|
|
38
|
+
"require": "./dist/enonic-ui.cjs"
|
|
39
|
+
},
|
|
40
|
+
"./style.css": "./dist/style.css"
|
|
41
|
+
},
|
|
42
|
+
"dependencies": {
|
|
43
|
+
"class-variance-authority": "^0.7.1",
|
|
44
|
+
"clsx": "^2.1.1",
|
|
45
|
+
"tailwind-merge": "^3.3.1"
|
|
46
|
+
},
|
|
47
|
+
"peerDependencies": {
|
|
48
|
+
"@preact/compat": ">=17.0.0 || >=18.0.0",
|
|
49
|
+
"preact": ">=10.0.0",
|
|
50
|
+
"react": ">=18.0.0 || >=19.0.0",
|
|
51
|
+
"react-dom": ">=18.0.0 || >=19.0.0"
|
|
52
|
+
},
|
|
53
|
+
"peerDependenciesMeta": {
|
|
54
|
+
"@preact/compat": {
|
|
55
|
+
"optional": true
|
|
56
|
+
},
|
|
57
|
+
"lucide-preact": {
|
|
58
|
+
"optional": true
|
|
59
|
+
},
|
|
60
|
+
"preact": {
|
|
61
|
+
"optional": true
|
|
62
|
+
},
|
|
63
|
+
"react": {
|
|
64
|
+
"optional": true
|
|
65
|
+
},
|
|
66
|
+
"react-dom": {
|
|
67
|
+
"optional": true
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"devDependencies": {
|
|
71
|
+
"@chromatic-com/storybook": "^4.0.1",
|
|
72
|
+
"@eslint/js": "^9.31.0",
|
|
73
|
+
"@preact/preset-vite": "^2.10.2",
|
|
74
|
+
"@size-limit/file": "^11.2.0",
|
|
75
|
+
"@size-limit/preset-small-lib": "^11.2.0",
|
|
76
|
+
"@storybook/addon-a11y": "^9.0.18",
|
|
77
|
+
"@storybook/addon-docs": "^9.0.18",
|
|
78
|
+
"@storybook/addon-links": "^9.0.18",
|
|
79
|
+
"@storybook/addon-themes": "^9.0.18",
|
|
80
|
+
"@storybook/preact-vite": "^9.0.18",
|
|
81
|
+
"@tailwindcss/vite": "^4.1.11",
|
|
82
|
+
"@trivago/prettier-plugin-sort-imports": "^5.2.2",
|
|
83
|
+
"@types/node": "^24.1.0",
|
|
84
|
+
"@typescript-eslint/eslint-plugin": "^8.38.0",
|
|
85
|
+
"@typescript-eslint/parser": "^8.38.0",
|
|
86
|
+
"eslint": "^9.31.0",
|
|
87
|
+
"eslint-import-resolver-typescript": "^4.4.4",
|
|
88
|
+
"eslint-plugin-import": "^2.32.0",
|
|
89
|
+
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
90
|
+
"eslint-plugin-react": "^7.37.5",
|
|
91
|
+
"eslint-plugin-react-hooks": "^5.2.0",
|
|
92
|
+
"husky": "^9.1.7",
|
|
93
|
+
"lint-staged": "^16.1.2",
|
|
94
|
+
"lucide-preact": "^0.525.0",
|
|
95
|
+
"lucide-react": "^0.525.0",
|
|
96
|
+
"postcss": "^8.5.6",
|
|
97
|
+
"prettier": "^3.6.2",
|
|
98
|
+
"rollup-plugin-visualizer": "^6.0.3",
|
|
99
|
+
"size-limit": "^11.2.0",
|
|
100
|
+
"storybook": "^9.0.18",
|
|
101
|
+
"tailwindcss": "^4.1.11",
|
|
102
|
+
"terser": "^5.43.1",
|
|
103
|
+
"typescript": "~5.8.3",
|
|
104
|
+
"typescript-eslint": "^8.38.0",
|
|
105
|
+
"vite": "^6.3.5",
|
|
106
|
+
"vite-plugin-dts": "^4.5.4",
|
|
107
|
+
"vite-plugin-environment": "^1.1.3"
|
|
108
|
+
},
|
|
109
|
+
"browserslist": {
|
|
110
|
+
"production": [
|
|
111
|
+
">0.2%",
|
|
112
|
+
"not dead",
|
|
113
|
+
"not op_mini all"
|
|
114
|
+
],
|
|
115
|
+
"development": [
|
|
116
|
+
"last 1 chrome version",
|
|
117
|
+
"last 1 firefox version",
|
|
118
|
+
"last 1 safari version"
|
|
119
|
+
]
|
|
120
|
+
},
|
|
121
|
+
"engines": {
|
|
122
|
+
"node": ">=22.17.1",
|
|
123
|
+
"pnpm": ">= 10.11.0",
|
|
124
|
+
"npm": ">=9.15.9"
|
|
125
|
+
},
|
|
126
|
+
"lint-staged": {
|
|
127
|
+
"src/**/*.{js,jsx,ts,tsx}": [
|
|
128
|
+
"eslint --fix --max-warnings 0",
|
|
129
|
+
"prettier --write"
|
|
130
|
+
],
|
|
131
|
+
"**/*.{json,md,yml,yaml}": [
|
|
132
|
+
"prettier --write"
|
|
133
|
+
]
|
|
134
|
+
},
|
|
135
|
+
"size-limit": [
|
|
136
|
+
{
|
|
137
|
+
"path": "dist/enonic-ui.es.js",
|
|
138
|
+
"limit": "35 KB"
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"path": "dist/enonic-ui.cjs",
|
|
142
|
+
"limit": "35 KB"
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"path": "dist/style.css",
|
|
146
|
+
"limit": "15 KB"
|
|
147
|
+
}
|
|
148
|
+
],
|
|
149
|
+
"scripts": {
|
|
150
|
+
"build": "pnpm clean && pnpm build:lib",
|
|
151
|
+
"build:lib": "pnpm compile && vite build",
|
|
152
|
+
"build:storybook": "storybook build",
|
|
153
|
+
"build:all": "pnpm build && pnpm build:storybook",
|
|
154
|
+
"dev": "storybook dev -p 6006",
|
|
155
|
+
"compile": "tsc -b",
|
|
156
|
+
"clean": "rm -rf dist coverage reports storybook-static",
|
|
157
|
+
"check": "pnpm typecheck && pnpm lint && pnpm format:check",
|
|
158
|
+
"typecheck": "tsc --noEmit",
|
|
159
|
+
"lint": "eslint --no-cache '**/*.{js,jsx,ts,tsx}' --max-warnings 0",
|
|
160
|
+
"lint:fix": "eslint --cache '**/*.{js,jsx,ts,tsx}' --fix",
|
|
161
|
+
"format": "prettier --write '**/*.{js,jsx,ts,tsx,json,md,yml,yaml}' --log-level warn",
|
|
162
|
+
"format:check": "prettier --check '**/*.{js,jsx,ts,tsx,json,md,yml,yaml}' --log-level warn",
|
|
163
|
+
"test": "exit 0",
|
|
164
|
+
"test:ci": "exit 0",
|
|
165
|
+
"release": "pnpm publish --access public --no-git-checks",
|
|
166
|
+
"release:dry": "pnpm publish --dry-run --access public --no-git-checks",
|
|
167
|
+
"analyze": "pnpm build && open dist/stats.html",
|
|
168
|
+
"size": "size-limit",
|
|
169
|
+
"preview": "pnpm dlx serve . -p 4000"
|
|
170
|
+
}
|
|
171
|
+
}
|