rocksolidjs 0.1.2 → 0.1.4
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/dist/AccordionContext/AccordionContext.js +1 -1
- package/dist/AccordionDetails/AccordionDetails.d.ts +2 -1
- package/dist/AccordionDetails/AccordionDetails.js +1 -1
- package/dist/AccordionDetails/style.d.ts +48 -0
- package/dist/AccordionDetails/style.js +1 -1
- package/dist/AccordionSummary/AccordionSummary.d.ts +6 -4
- package/dist/AccordionSummary/AccordionSummary.js +1 -1
- package/dist/Alert/Alert.d.ts +8 -6
- package/dist/Alert/Alert.js +1 -1
- package/dist/Alert/style.d.ts +6 -0
- package/dist/Alert/style.js +1 -1
- package/dist/Avatar/Avatar.d.ts +5 -3
- package/dist/Avatar/Avatar.js +1 -1
- package/dist/Avatar/style.js +1 -1
- package/dist/Badge/Badge.d.ts +7 -5
- package/dist/Badge/Badge.js +1 -1
- package/dist/Badge/style.js +1 -1
- package/dist/Breadcrumbs/Breadcrumbs.d.ts +7 -5
- package/dist/Breadcrumbs/Breadcrumbs.js +1 -1
- package/dist/Button/Button.d.ts +8 -6
- package/dist/Button/Button.js +1 -1
- package/dist/Button/index.js +1 -1
- package/dist/Button/style.d.ts +48 -0
- package/dist/Button/style.js +1 -1
- package/dist/ButtonGroup/ButtonGroup.d.ts +19 -0
- package/dist/ButtonGroup/ButtonGroup.js +1 -0
- package/dist/ButtonGroup/ButtonGroupContext.d.ts +12 -0
- package/dist/ButtonGroup/ButtonGroupContext.js +1 -0
- package/dist/ButtonGroup/index.d.ts +2 -0
- package/dist/ButtonGroup/index.js +1 -0
- package/dist/ButtonGroup/style.d.ts +88 -0
- package/dist/ButtonGroup/style.js +1 -0
- package/dist/CardFooter/style.d.ts +2 -2
- package/dist/CardFooter/style.js +1 -1
- package/dist/CardTitle/CardTitle.d.ts +4 -4
- package/dist/Checkbox/Checkbox.d.ts +8 -4
- package/dist/Checkbox/Checkbox.js +1 -1
- package/dist/Chip/Chip.d.ts +6 -4
- package/dist/Chip/Chip.js +1 -1
- package/dist/Chip/style.d.ts +6 -18
- package/dist/Chip/style.js +1 -1
- package/dist/Dialog/Dialog.d.ts +7 -4
- package/dist/Dialog/Dialog.js +1 -1
- package/dist/Dialog/style.js +1 -1
- package/dist/DialogTitle/DialogTitle.d.ts +4 -4
- package/dist/Divider/Divider.d.ts +7 -0
- package/dist/Divider/Divider.js +1 -1
- package/dist/Divider/style.d.ts +138 -18
- package/dist/Divider/style.js +1 -1
- package/dist/IconButton/IconButton.d.ts +4 -3
- package/dist/IconButton/IconButton.js +1 -1
- package/dist/IconButton/style.js +1 -1
- package/dist/Input/Input.d.ts +7 -5
- package/dist/Input/Input.js +1 -1
- package/dist/Input/style.js +1 -1
- package/dist/Link/style.d.ts +6 -6
- package/dist/Link/style.js +1 -1
- package/dist/Progress/Progress.d.ts +7 -5
- package/dist/Progress/Progress.js +1 -1
- package/dist/Progress/style.js +1 -1
- package/dist/Radio/Radio.d.ts +8 -4
- package/dist/Radio/Radio.js +1 -1
- package/dist/Select/Select.d.ts +10 -2
- package/dist/Select/Select.js +1 -1
- package/dist/Select/style.d.ts +156 -78
- package/dist/Select/style.js +1 -1
- package/dist/Skeleton/Skeleton.d.ts +2 -2
- package/dist/Skeleton/Skeleton.js +1 -1
- package/dist/Spinner/Spinner.d.ts +1 -1
- package/dist/Spinner/Spinner.js +1 -1
- package/dist/Switch/Switch.d.ts +6 -4
- package/dist/Switch/Switch.js +1 -1
- package/dist/Switch/style.js +1 -1
- package/dist/Tab/Tab.js +1 -1
- package/dist/Tab/style.js +1 -1
- package/dist/TableCell/TableCell.js +1 -1
- package/dist/TableContext/TableContext.d.ts +1 -1
- package/dist/TableContext/TableContext.js +1 -1
- package/dist/TabsContext/context.js +1 -1
- package/dist/ThemeProvider/componentsTV.d.ts +245 -58
- package/dist/ThemeProvider/componentsTV.js +1 -1
- package/dist/_chunks/Button-D7kRTDWq.js +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +1 -1
- package/dist/styles/createTheme.js +2 -1
- package/dist/styles/index.js +1 -1
- package/dist/styles/theme/colors.js +1 -1
- package/dist/styles/theme/disabled.js +1 -1
- package/dist/styles/theme/themeSchema.js +1 -1
- package/dist/styles/theme/utilities.js +1 -1
- package/dist/styles/useTheme.js +1 -1
- package/dist/types/ExtendedComponentProps.d.ts +6 -0
- package/dist/types/ExtendedComponentProps.js +0 -0
- package/dist/types/Prettify.d.ts +3 -0
- package/dist/types/Prettify.js +0 -0
- package/package.json +15 -2
- package/dist/_chunks/createTheme-DT5vPeEE.js +0 -2
- package/dist/_chunks/themeSchema-BFl6XiaJ.js +0 -1
package/dist/CardFooter/style.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"../styles/theme/index.js";import{tv as t}from"tailwind-variants";var n=(n=e)=>t({base:`flex items-center gap-2 px-4
|
|
1
|
+
import e from"../styles/theme/index.js";import{tv as t}from"tailwind-variants";var n=(n=e)=>t({base:`flex items-center gap-2 px-4 pt-3 pb-4`}),r=n();export{n as cardFooter,r as default};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { JSXElement } from 'solid-js';
|
|
1
|
+
import { JSXElement, ValidComponent } from 'solid-js';
|
|
2
2
|
import { TypographyProps } from '../Typography/Typography';
|
|
3
|
-
export type CardTitleProps = {
|
|
3
|
+
export type CardTitleProps<T extends ValidComponent = "h2"> = {
|
|
4
4
|
class?: string;
|
|
5
5
|
children?: JSXElement;
|
|
6
|
-
} & TypographyProps
|
|
7
|
-
declare const CardTitle: (props: CardTitleProps) => import("solid-js").JSX.Element;
|
|
6
|
+
} & TypographyProps<T>;
|
|
7
|
+
declare const CardTitle: <T extends ValidComponent = "h2">(props: CardTitleProps<T>) => import("solid-js").JSX.Element;
|
|
8
8
|
export default CardTitle;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import { ComponentProps } from 'solid-js';
|
|
1
|
+
import { ComponentProps, JSXElement } from 'solid-js';
|
|
2
|
+
import { Prettify } from '../types/Prettify';
|
|
3
|
+
import { WithExtendedComponentProps } from '../types/ExtendedComponentProps';
|
|
2
4
|
import { IconButtonProps } from '../IconButton';
|
|
3
|
-
type CheckboxSlotProps = {
|
|
4
|
-
base?: ComponentProps<"span">;
|
|
5
|
-
}
|
|
5
|
+
type CheckboxSlotProps = Prettify<{
|
|
6
|
+
base?: Prettify<ComponentProps<"span"> & WithExtendedComponentProps>;
|
|
7
|
+
}>;
|
|
6
8
|
export type CheckboxProps = {
|
|
7
9
|
checked?: boolean;
|
|
10
|
+
checkedIcon?: JSXElement;
|
|
8
11
|
class?: string;
|
|
9
12
|
color?: IconButtonProps["color"];
|
|
10
13
|
defaultChecked?: boolean;
|
|
@@ -13,6 +16,7 @@ export type CheckboxProps = {
|
|
|
13
16
|
onChange?: (event: Event, checked: boolean) => void;
|
|
14
17
|
size?: IconButtonProps["size"];
|
|
15
18
|
slotProps?: CheckboxSlotProps;
|
|
19
|
+
uncheckedIcon?: JSXElement;
|
|
16
20
|
} & Omit<ComponentProps<"input">, "onChange">;
|
|
17
21
|
declare const Checkbox: (props: CheckboxProps) => import("solid-js").JSX.Element;
|
|
18
22
|
export default Checkbox;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"../utils/cn.js";import t from"./style.js";import{useThemeContext as n}from"../ThemeProvider/ThemeContext.js";import"../ThemeProvider/index.js";import r from"../IconButton/IconButton.js";import"../IconButton/index.js";import i from"../icons/CheckboxChecked.js";import a from"../icons/CheckboxUnchecked.js";import{createComponent as o,memo as s,mergeProps as c,spread as l,template as u}from"solid-js/web";import{createMemo as d,createSignal as f,splitProps as
|
|
1
|
+
import e from"../utils/cn.js";import t from"./style.js";import{useThemeContext as n}from"../ThemeProvider/ThemeContext.js";import"../ThemeProvider/index.js";import"../types/Prettify.js";import"../types/ExtendedComponentProps.js";import r from"../IconButton/IconButton.js";import"../IconButton/index.js";import i from"../icons/CheckboxChecked.js";import a from"../icons/CheckboxUnchecked.js";import{createComponent as o,memo as s,mergeProps as c,spread as l,template as u}from"solid-js/web";import{createMemo as d,createSignal as f,mergeProps as p,splitProps as m}from"solid-js";var h=u(`<input>`),g=u=>{let g=p({checkedIcon:o(i,{}),uncheckedIcon:o(a,{})},u),[_,v]=m(g,[`checked`,`checkedIcon`,`class`,`color`,`defaultChecked`,`disabled`,`id`,`onChange`,`size`,`slotProps`,`uncheckedIcon`,`children`]),y=n(),b=typeof _.checked==`boolean`,[x,S]=f(!!_.defaultChecked),C=d(()=>b?_.checked:x()),w=e=>{let t=e.currentTarget.checked;b||S(t),_.onChange?.(e,t)},T=d(()=>{let e={checked:C(),disabled:_.disabled};return y?y.componentsTV.checkbox(e):t(e)});return o(r,c(()=>_.slotProps?.base,{as:`span`,get class(){return e(T().base(),_.slotProps?.base?.class)},get color(){return _.color},get size(){return _.size},get disabled(){return _.disabled},get children(){return[s(()=>s(()=>!!C())()?_.checkedIcon:_.uncheckedIcon),(()=>{var t=h();return l(t,c(v,{get id(){return _.id},type:`checkbox`,get checked(){return C()},onChange:w,get disabled(){return _.disabled},get class(){return e(T().input(),_.class)}}),!1,!1),t})()]}}))};export{g as default};
|
package/dist/Chip/Chip.d.ts
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { ComponentProps, JSXElement } from 'solid-js';
|
|
2
|
+
import { Prettify } from '../types/Prettify';
|
|
3
|
+
import { WithExtendedComponentProps } from '../types/ExtendedComponentProps';
|
|
2
4
|
import { VariantProps } from 'tailwind-variants';
|
|
3
5
|
import { TypographyProps } from '../Typography/Typography';
|
|
4
6
|
import { ThemeColors } from '../styles/theme/colors';
|
|
5
7
|
import { default as chipDefaultStyles } from './style';
|
|
6
8
|
type ChipVariants = VariantProps<typeof chipDefaultStyles>;
|
|
7
|
-
type ChipSlotProps = {
|
|
8
|
-
deleteIcon?: ComponentProps<"span">;
|
|
9
|
-
label?: TypographyProps
|
|
10
|
-
}
|
|
9
|
+
type ChipSlotProps = Prettify<{
|
|
10
|
+
deleteIcon?: Prettify<ComponentProps<"span"> & WithExtendedComponentProps>;
|
|
11
|
+
label?: Prettify<TypographyProps<"span"> & WithExtendedComponentProps>;
|
|
12
|
+
}>;
|
|
11
13
|
export type ChipProps = {
|
|
12
14
|
avatar?: JSXElement;
|
|
13
15
|
color?: keyof ThemeColors;
|
package/dist/Chip/Chip.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"../utils/cn.js";import t from"./style.js";import{useThemeContext as n}from"../ThemeProvider/ThemeContext.js";import"../ThemeProvider/index.js";import r from"../Typography/Typography.js";import i from"../icons/Cross.js";import{Dynamic as a,createComponent as o,insert as s,memo as c,mergeProps as l,spread as u,template as d}from"solid-js/web";import{createMemo as f,mergeProps as p,splitProps as m}from"solid-js";import"tailwind-variants";var h=d(`<span>`),g=d=>{let g=p({color:`default`,variant:`filled`,size:`medium`,disabled:!1},d),[_,v]=m(g,[`avatar`,`class`,`color`,`deleteIcon`,`disabled`,`icon`,`label`,`onClick`,`onDelete`,`slotProps`,`variant`,`size`,`children`]),y=n(),b=f(()=>_.avatar?_.avatar:_.icon?_.icon:null),x=f(()=>!!_.avatar),S=f(()=>typeof _.onDelete==`function`),C=f(()=>typeof _.onClick==`function`),w=e=>{_.disabled||(e.stopPropagation(),_.onDelete?.(e))},T=f(()=>{let e={color:_.color,disabled:_.disabled,variant:_.variant,size:_.size,hasAvatarElement:x(),hasDeleteIcon:S(),clickable:C()};return y?y.componentsTV.chip(e):t(e)}),E=f(()=>S()?_.deleteIcon?_.deleteIcon:o(i,{}):null);return o(a,l(v,{get component(){return C()?`button`:`div`},get"aria-disabled"(){return _.disabled},get onClick(){return c(()=>!_.disabled)()?_.onClick:void 0},get tabIndex(){return C()&&!_.disabled?0
|
|
1
|
+
import e from"../utils/cn.js";import t from"./style.js";import{useThemeContext as n}from"../ThemeProvider/ThemeContext.js";import"../ThemeProvider/index.js";import"../types/Prettify.js";import"../types/ExtendedComponentProps.js";import r from"../Typography/Typography.js";import i from"../icons/Cross.js";import{Dynamic as a,createComponent as o,insert as s,memo as c,mergeProps as l,spread as u,template as d}from"solid-js/web";import{createMemo as f,mergeProps as p,splitProps as m}from"solid-js";import"tailwind-variants";var h=d(`<span>`),g=d=>{let g=p({color:`default`,variant:`filled`,size:`medium`,disabled:!1},d),[_,v]=m(g,[`avatar`,`class`,`color`,`deleteIcon`,`disabled`,`icon`,`label`,`onClick`,`onDelete`,`slotProps`,`variant`,`size`,`children`]),y=n(),b=f(()=>_.avatar?_.avatar:_.icon?_.icon:null),x=f(()=>!!_.avatar),S=f(()=>typeof _.onDelete==`function`),C=f(()=>typeof _.onClick==`function`),w=e=>{_.disabled||(e.stopPropagation(),_.onDelete?.(e))},T=f(()=>{let e={color:_.color,disabled:_.disabled,variant:_.variant,size:_.size,hasAvatarElement:x(),hasDeleteIcon:S(),clickable:C()};return y?y.componentsTV.chip(e):t(e)}),E=f(()=>S()?_.deleteIcon?_.deleteIcon:o(i,{}):null);return o(a,l(v,{get component(){return C()?`button`:`div`},get"aria-disabled"(){return _.disabled},get onClick(){return c(()=>!_.disabled)()?_.onClick:void 0},get tabIndex(){return C()&&!_.disabled?0:-1},get class(){return e(T().base(),_.class)},get children(){return[c(()=>b()),o(r,l(()=>_.slotProps?.label,{as:`span`,variant:`inherit`,truncate:!0,get class(){return e(T().label(),_.slotProps?.label?.class)},get children(){return _.label}})),(()=>{var t=h();return u(t,l(()=>_.slotProps?.deleteIcon,{get class(){return e(T().deleteIcon(),_.slotProps?.deleteIcon?.class)},onClick:w}),!1,!0),s(t,E),t})()]}}))};export{g as default};
|
package/dist/Chip/style.d.ts
CHANGED
|
@@ -31,9 +31,7 @@ export declare const chip: (theme?: Theme) => import('tailwind-variants').TVRetu
|
|
|
31
31
|
};
|
|
32
32
|
};
|
|
33
33
|
clickable: {
|
|
34
|
-
true: {
|
|
35
|
-
base: string[];
|
|
36
|
-
};
|
|
34
|
+
true: {};
|
|
37
35
|
false: {};
|
|
38
36
|
};
|
|
39
37
|
hasDeleteIcon: {
|
|
@@ -80,9 +78,7 @@ export declare const chip: (theme?: Theme) => import('tailwind-variants').TVRetu
|
|
|
80
78
|
};
|
|
81
79
|
};
|
|
82
80
|
clickable: {
|
|
83
|
-
true: {
|
|
84
|
-
base: string[];
|
|
85
|
-
};
|
|
81
|
+
true: {};
|
|
86
82
|
false: {};
|
|
87
83
|
};
|
|
88
84
|
hasDeleteIcon: {
|
|
@@ -129,9 +125,7 @@ export declare const chip: (theme?: Theme) => import('tailwind-variants').TVRetu
|
|
|
129
125
|
};
|
|
130
126
|
};
|
|
131
127
|
clickable: {
|
|
132
|
-
true: {
|
|
133
|
-
base: string[];
|
|
134
|
-
};
|
|
128
|
+
true: {};
|
|
135
129
|
false: {};
|
|
136
130
|
};
|
|
137
131
|
hasDeleteIcon: {
|
|
@@ -179,9 +173,7 @@ declare const _default: import('tailwind-variants').TVReturnType<{
|
|
|
179
173
|
};
|
|
180
174
|
};
|
|
181
175
|
clickable: {
|
|
182
|
-
true: {
|
|
183
|
-
base: string[];
|
|
184
|
-
};
|
|
176
|
+
true: {};
|
|
185
177
|
false: {};
|
|
186
178
|
};
|
|
187
179
|
hasDeleteIcon: {
|
|
@@ -228,9 +220,7 @@ declare const _default: import('tailwind-variants').TVReturnType<{
|
|
|
228
220
|
};
|
|
229
221
|
};
|
|
230
222
|
clickable: {
|
|
231
|
-
true: {
|
|
232
|
-
base: string[];
|
|
233
|
-
};
|
|
223
|
+
true: {};
|
|
234
224
|
false: {};
|
|
235
225
|
};
|
|
236
226
|
hasDeleteIcon: {
|
|
@@ -277,9 +267,7 @@ declare const _default: import('tailwind-variants').TVReturnType<{
|
|
|
277
267
|
};
|
|
278
268
|
};
|
|
279
269
|
clickable: {
|
|
280
|
-
true: {
|
|
281
|
-
base: string[];
|
|
282
|
-
};
|
|
270
|
+
true: {};
|
|
283
271
|
false: {};
|
|
284
272
|
};
|
|
285
273
|
hasDeleteIcon: {
|
package/dist/Chip/style.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"../styles/theme/index.js";import t from"../utils/asVariant.js";import n from"../utils/typedKeys.js";import{tv as r}from"tailwind-variants";var i=[`solid`,`filled`,`outlined`],a=(a=e)=>r({slots:{base:[`inline-flex items-center gap-1 max-w-full`,`font-normal align-middle`,a.typography.colors.textPrimary,a.rounded.full],label:``,deleteIcon:`shrink-0`},variants:{color:t(a.colors,()=>({})),variant:{solid:{},filled:{},outlined:{base:`border`}},disabled:{true:{base:`
|
|
1
|
+
import e from"../styles/theme/index.js";import t from"../utils/asVariant.js";import n from"../utils/typedKeys.js";import{tv as r}from"tailwind-variants";var i=[`solid`,`filled`,`outlined`],a=(a=e)=>r({slots:{base:[`inline-flex items-center gap-1 max-w-full`,`font-normal align-middle`,a.typography.colors.textPrimary,a.rounded.full],label:``,deleteIcon:`shrink-0`},variants:{color:t(a.colors,()=>({})),variant:{solid:{},filled:{},outlined:{base:`border`}},disabled:{true:{base:`pointer-events-none`},false:{deleteIcon:`cursor-pointer`}},size:{small:{base:`h-6 px-1.5 py-[2px] gap-[2px] text-xs`,deleteIcon:`text-md`},medium:{base:`h-7 px-2.5 py-1 gap-[3px] text-sm`,deleteIcon:`text-lg`},large:{base:`h-8 px-3 py-1.5 gap-1 text-md`,deleteIcon:`text-xl`}},clickable:{true:{},false:{}},hasDeleteIcon:{true:{},false:{}},hasAvatarElement:{true:{},false:{}}},compoundVariants:[...n(a.colors).flatMap(e=>i.map(t=>{let n=a.colors[e][t];return[{color:e,variant:t,clickable:!1,disabled:!1,class:{base:[n.background,n.border,n.text]}},{color:e,variant:t,clickable:!0,disabled:!1,class:{base:[`cursor-pointer`,n.background,n.border,n.text,n.hover,n.active]}},{color:e,variant:t,disabled:!0,class:{base:[a.disabled.text,[`outlined`].includes(t)?a.disabled.border:``,[`solid`,`filled`].includes(t)?a.disabled.background:``]}}]}).flat()),{hasDeleteIcon:!0,size:`small`,class:{base:`ps-1.5 pe-1`}},{hasDeleteIcon:!0,size:`medium`,class:{base:`ps-2.5 pe-1.5`}},{hasDeleteIcon:!0,size:`large`,class:{base:`ps-3 pe-2`}},{hasAvatarElement:!0,size:`small`,class:{base:`ps-[2px]`,label:`ps-[1px]`}},{hasAvatarElement:!0,size:`medium`,class:{base:`ps-[3px]`,label:`ps-[2px]`}},{hasAvatarElement:!0,size:`large`,class:{base:`ps-1`,label:`ps-[3px]`}},{clickable:!0,disabled:!1,class:{base:[a.focus]}}]}),o=a();export{a as chip,o as default};
|
package/dist/Dialog/Dialog.d.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { ComponentProps, JSXElement } from 'solid-js';
|
|
2
|
+
import { Prettify } from '../types/Prettify';
|
|
3
|
+
import { WithExtendedComponentProps } from '../types/ExtendedComponentProps';
|
|
2
4
|
import { VariantProps } from 'tailwind-variants';
|
|
3
5
|
import { BackdropProps } from '../Backdrop';
|
|
4
6
|
import { default as dialogDefaultStyles } from './style';
|
|
5
7
|
type DialogVariants = VariantProps<typeof dialogDefaultStyles>;
|
|
6
|
-
type DialogSlotProps = {
|
|
7
|
-
backdrop?: BackdropProps
|
|
8
|
-
}
|
|
8
|
+
type DialogSlotProps = Prettify<{
|
|
9
|
+
backdrop?: Prettify<BackdropProps & WithExtendedComponentProps>;
|
|
10
|
+
}>;
|
|
9
11
|
export type DialogCloseReason = "escape" | "backdrop";
|
|
10
12
|
export type DialogProps = {
|
|
11
13
|
children?: JSXElement;
|
|
@@ -13,8 +15,9 @@ export type DialogProps = {
|
|
|
13
15
|
fullscreen?: DialogVariants["fullscreen"];
|
|
14
16
|
onClose?: (event: Event, reason: DialogCloseReason) => void;
|
|
15
17
|
open?: boolean;
|
|
18
|
+
ref?: (element: HTMLDivElement) => void;
|
|
16
19
|
role?: "alertdialog" | "dialog";
|
|
17
20
|
slotProps?: DialogSlotProps;
|
|
18
|
-
} & Omit<ComponentProps<"div">, "onClose">;
|
|
21
|
+
} & Omit<ComponentProps<"div">, "onClose" | "ref">;
|
|
19
22
|
declare const Dialog: (props: DialogProps) => import("solid-js").JSX.Element;
|
|
20
23
|
export default Dialog;
|
package/dist/Dialog/Dialog.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"../utils/cn.js";import t from"./style.js";import{useThemeContext as n}from"../ThemeProvider/ThemeContext.js";import"../ThemeProvider/index.js";import r from"../Backdrop/Backdrop.js";import"../Backdrop/index.js";import{Portal as i,createComponent as a,insert as o,mergeProps as s,spread as c,template as l,use as u}from"solid-js/web";import{Show as d,createEffect as f,createMemo as p,mergeProps as m,onCleanup as h,splitProps as g}from"solid-js";import"tailwind-variants";var _=l(`<div role=dialog aria-modal=true>`),v=[`a[href]`,`button:not([disabled])`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`[tabindex]:not([tabindex='-1'])`].join(`,`),y=l=>{let y=m({fullscreen:!1},l),[b,x]=g(y,[`class`,`children`,`fullscreen`,`open`,`onClose`,`slotProps`]),S=n(),C,w=()=>C?Array.from(C.querySelectorAll(v)).filter(e=>{let t=getComputedStyle(e);return!e.hasAttribute(`disabled`)&&t.display!==`none`&&t.visibility!==`hidden`}):[],T=()=>{let e=w()[0];e?e.focus():C.focus()},E=()=>{let e=w(),t=e[e.length-1];t?t.focus():C.focus()},D=e=>{if(!b.open||!C)return;if(e.key===`Escape`){e.preventDefault(),b.onClose?.(e,`escape`);return}if(e.key!==`Tab`)return;let t=w();if(t.length===0){e.preventDefault(),C.focus();return}let n=t[0],r=t[t.length-1],i=document.activeElement;if(!C.contains(i)){e.preventDefault(),e.shiftKey?E():T();return}if(e.shiftKey&&i===n){e.preventDefault(),r.focus();return}!e.shiftKey&&i===r&&(e.preventDefault(),n.focus())},O=e=>{if(!b.open||!C)return;let t=e.target;t instanceof Node&&(C.contains(t)||T())};f(()=>{if(!b.open){document.body.classList.remove(`overflow-hidden`);return}document.body.classList.add(`overflow-hidden`),document.addEventListener(`keydown`,D),document.addEventListener(`focusin`,O),h(()=>{document.removeEventListener(`keydown`,D),document.removeEventListener(`focusin`,O)})});let k=e=>{e.target===C||C.contains(e.target)||(b.onClose?.(e,`backdrop`),b.slotProps?.backdrop?.onClick?.(e))},A=p(()=>{let e={fullscreen:b.fullscreen};return S?S.componentsTV.dialog(e):t(e)});return a(d,{get when(){return b.open},get children(){return a(i,{get children(){return a(r,s(()=>b.slotProps?.backdrop,{onClick:k,get children(){var t=_()
|
|
1
|
+
import e from"../utils/cn.js";import t from"./style.js";import{useThemeContext as n}from"../ThemeProvider/ThemeContext.js";import"../ThemeProvider/index.js";import"../types/Prettify.js";import"../types/ExtendedComponentProps.js";import r from"../Backdrop/Backdrop.js";import"../Backdrop/index.js";import{Portal as i,createComponent as a,insert as o,mergeProps as s,spread as c,template as l,use as u}from"solid-js/web";import{Show as d,createEffect as f,createMemo as p,mergeProps as m,onCleanup as h,splitProps as g}from"solid-js";import"tailwind-variants";var _=l(`<div role=dialog aria-modal=true>`),v=[`a[href]`,`button:not([disabled])`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`[tabindex]:not([tabindex='-1'])`].join(`,`),y=l=>{let y=m({fullscreen:!1},l),[b,x]=g(y,[`class`,`children`,`fullscreen`,`open`,`onClose`,`ref`,`slotProps`]),S=n(),C,w=()=>C?Array.from(C.querySelectorAll(v)).filter(e=>{let t=getComputedStyle(e);return!e.hasAttribute(`disabled`)&&t.display!==`none`&&t.visibility!==`hidden`}):[],T=()=>{let e=w()[0];e?e.focus():C.focus()},E=()=>{let e=w(),t=e[e.length-1];t?t.focus():C.focus()},D=e=>{if(!b.open||!C)return;if(e.key===`Escape`){e.preventDefault(),b.onClose?.(e,`escape`);return}if(e.key!==`Tab`)return;let t=w();if(t.length===0){e.preventDefault(),C.focus();return}let n=t[0],r=t[t.length-1],i=document.activeElement;if(!C.contains(i)){e.preventDefault(),e.shiftKey?E():T();return}if(e.shiftKey&&i===n){e.preventDefault(),r.focus();return}!e.shiftKey&&i===r&&(e.preventDefault(),n.focus())},O=e=>{if(!b.open||!C)return;let t=e.target;t instanceof Node&&(C.contains(t)||T())};f(()=>{if(!b.open){document.body.classList.remove(`overflow-hidden`);return}document.body.classList.add(`overflow-hidden`),document.addEventListener(`keydown`,D),document.addEventListener(`focusin`,O),h(()=>{document.removeEventListener(`keydown`,D),document.removeEventListener(`focusin`,O)})});let k=e=>{e.target===C||C.contains(e.target)||(b.onClose?.(e,`backdrop`),b.slotProps?.backdrop?.onClick?.(e))},A=p(()=>{let e={fullscreen:b.fullscreen};return S?S.componentsTV.dialog(e):t(e)});return a(d,{get when(){return b.open},get children(){return a(i,{get children(){return a(r,s(()=>b.slotProps?.backdrop,{onClick:k,get children(){var t=_();return u(e=>{C=e,b.ref?.(e)},t),c(t,s(x,{get class(){return e(A(),b.class)}}),!1,!0),o(t,()=>b.children),t}}))}})}})};export{y as default};
|
package/dist/Dialog/style.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"../styles/theme/index.js";import{tv as t}from"tailwind-variants";var n=(n=e)=>t({base:[`fixed min-w-xs shadow-sm z-2`,`bg-white dark:bg-neutral-900`,`dark:border`,n.divider],variants:{fullscreen:{true:`w-full h-full`,false:[`top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2`,`
|
|
1
|
+
import e from"../styles/theme/index.js";import{tv as t}from"tailwind-variants";var n=(n=e)=>t({base:[`fixed min-w-xs shadow-sm z-2`,`bg-white dark:bg-neutral-900`,`dark:border`,n.divider],variants:{fullscreen:{true:`w-full h-full`,false:[`top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2`,`max-w-[calc(100vw_-_2rem)] max-h-[calc(100vh_-_2rem)]`,n.rounded.small]}}}),r=n();export{r as default,n as dialog};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { JSXElement } from 'solid-js';
|
|
1
|
+
import { JSXElement, ValidComponent } from 'solid-js';
|
|
2
2
|
import { TypographyProps } from '../Typography/Typography';
|
|
3
|
-
export type DialogTitleProps = {
|
|
3
|
+
export type DialogTitleProps<T extends ValidComponent = "h3"> = {
|
|
4
4
|
class?: string;
|
|
5
5
|
children?: JSXElement;
|
|
6
|
-
} & TypographyProps
|
|
7
|
-
declare const DialogTitle: (props: DialogTitleProps) => import("solid-js").JSX.Element;
|
|
6
|
+
} & TypographyProps<T>;
|
|
7
|
+
declare const DialogTitle: <T extends ValidComponent = "h3">(props: DialogTitleProps<T>) => import("solid-js").JSX.Element;
|
|
8
8
|
export default DialogTitle;
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import { ComponentProps, ValidComponent } from 'solid-js';
|
|
2
|
+
import { Prettify } from '../types/Prettify';
|
|
3
|
+
import { WithExtendedComponentProps } from '../types/ExtendedComponentProps';
|
|
2
4
|
import { VariantProps } from 'tailwind-variants';
|
|
3
5
|
import { default as dividerDefaultStyles } from './style';
|
|
4
6
|
type DividerVariants = VariantProps<typeof dividerDefaultStyles>;
|
|
7
|
+
type DividerSlotProps = Prettify<{
|
|
8
|
+
divider?: Prettify<ComponentProps<"span"> & WithExtendedComponentProps>;
|
|
9
|
+
}>;
|
|
5
10
|
export type DividerProps<T extends ValidComponent = "div"> = {
|
|
11
|
+
align?: DividerVariants["align"];
|
|
6
12
|
as?: T;
|
|
7
13
|
class?: string;
|
|
8
14
|
orientation?: DividerVariants["orientation"];
|
|
15
|
+
slotProps?: DividerSlotProps;
|
|
9
16
|
} & ComponentProps<T>;
|
|
10
17
|
declare const Divider: <T extends ValidComponent = "div">(props: DividerProps<T>) => import("solid-js").JSX.Element;
|
|
11
18
|
export default Divider;
|
package/dist/Divider/Divider.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"../utils/cn.js";import t from"./style.js";import{useThemeContext as n}from"../ThemeProvider/ThemeContext.js";import"../ThemeProvider/index.js";import{Dynamic as r,createComponent as i,mergeProps as
|
|
1
|
+
import e from"../utils/cn.js";import t from"./style.js";import{useThemeContext as n}from"../ThemeProvider/ThemeContext.js";import"../ThemeProvider/index.js";import"../types/Prettify.js";import"../types/ExtendedComponentProps.js";import{Dynamic as r,createComponent as i,memo as a,mergeProps as o,spread as s,template as c}from"solid-js/web";import{Show as l,createMemo as u,mergeProps as d,splitProps as f}from"solid-js";import"tailwind-variants";var p=c(`<span>`),m=c=>{let m=d({align:`center`,orientation:`horizontal`},c),[h,g]=f(m,[`align`,`as`,`class`,`children`,`orientation`,`slotProps`]),_=n(),v=u(()=>!!h.children),y=u(()=>{let e={align:h.align,hasChildren:v(),orientation:h.orientation};return _?_.componentsTV.divider(e):t(e)});return i(r,o({role:`separator`,get"aria-orientation"(){return h.orientation===`horizontal`?`horizontal`:`vertical`}},g,{get component(){return h.as||`div`},get class(){return e(y().base(),h.class)},get children(){return[(()=>{var t=p();return s(t,o(()=>h.slotProps?.divider,{get class(){return e(y().divider(),y().beforeDivider(),h.slotProps?.divider?.class)}}),!1,!1),t})(),i(l,{get when(){return v()},get children(){return[a(()=>h.children),(()=>{var t=p();return s(t,o(()=>h.slotProps?.divider,{get class(){return e(y().divider(),y().afterDivider(),h.slotProps?.divider?.class)}}),!1,!1),t})()]}})]}}))};export{m as default};
|
package/dist/Divider/style.d.ts
CHANGED
|
@@ -1,34 +1,154 @@
|
|
|
1
1
|
import { Theme } from '../styles/theme';
|
|
2
2
|
export declare const divider: (theme?: Theme) => import('tailwind-variants').TVReturnType<{
|
|
3
|
+
align: {
|
|
4
|
+
start: {};
|
|
5
|
+
center: {};
|
|
6
|
+
end: {};
|
|
7
|
+
};
|
|
8
|
+
hasChildren: {
|
|
9
|
+
true: {};
|
|
10
|
+
false: {};
|
|
11
|
+
};
|
|
3
12
|
orientation: {
|
|
4
|
-
horizontal:
|
|
5
|
-
|
|
13
|
+
horizontal: {
|
|
14
|
+
base: string;
|
|
15
|
+
divider: string;
|
|
16
|
+
};
|
|
17
|
+
vertical: {
|
|
18
|
+
base: string;
|
|
19
|
+
divider: string;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
}, {
|
|
23
|
+
base: string[];
|
|
24
|
+
divider: string[];
|
|
25
|
+
beforeDivider: string;
|
|
26
|
+
afterDivider: string;
|
|
27
|
+
}, undefined, {
|
|
28
|
+
align: {
|
|
29
|
+
start: {};
|
|
30
|
+
center: {};
|
|
31
|
+
end: {};
|
|
32
|
+
};
|
|
33
|
+
hasChildren: {
|
|
34
|
+
true: {};
|
|
35
|
+
false: {};
|
|
6
36
|
};
|
|
7
|
-
}, undefined, string[], {
|
|
8
37
|
orientation: {
|
|
9
|
-
horizontal:
|
|
10
|
-
|
|
38
|
+
horizontal: {
|
|
39
|
+
base: string;
|
|
40
|
+
divider: string;
|
|
41
|
+
};
|
|
42
|
+
vertical: {
|
|
43
|
+
base: string;
|
|
44
|
+
divider: string;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
}, {
|
|
48
|
+
base: string[];
|
|
49
|
+
divider: string[];
|
|
50
|
+
beforeDivider: string;
|
|
51
|
+
afterDivider: string;
|
|
52
|
+
}, import('tailwind-variants').TVReturnTypeLike<{
|
|
53
|
+
align: {
|
|
54
|
+
start: {};
|
|
55
|
+
center: {};
|
|
56
|
+
end: {};
|
|
57
|
+
};
|
|
58
|
+
hasChildren: {
|
|
59
|
+
true: {};
|
|
60
|
+
false: {};
|
|
11
61
|
};
|
|
12
|
-
}, undefined, import('tailwind-variants').TVReturnTypeLike<{
|
|
13
62
|
orientation: {
|
|
14
|
-
horizontal:
|
|
15
|
-
|
|
63
|
+
horizontal: {
|
|
64
|
+
base: string;
|
|
65
|
+
divider: string;
|
|
66
|
+
};
|
|
67
|
+
vertical: {
|
|
68
|
+
base: string;
|
|
69
|
+
divider: string;
|
|
70
|
+
};
|
|
16
71
|
};
|
|
17
|
-
},
|
|
72
|
+
}, {
|
|
73
|
+
base: string[];
|
|
74
|
+
divider: string[];
|
|
75
|
+
beforeDivider: string;
|
|
76
|
+
afterDivider: string;
|
|
77
|
+
}>>;
|
|
18
78
|
declare const _default: import('tailwind-variants').TVReturnType<{
|
|
79
|
+
align: {
|
|
80
|
+
start: {};
|
|
81
|
+
center: {};
|
|
82
|
+
end: {};
|
|
83
|
+
};
|
|
84
|
+
hasChildren: {
|
|
85
|
+
true: {};
|
|
86
|
+
false: {};
|
|
87
|
+
};
|
|
19
88
|
orientation: {
|
|
20
|
-
horizontal:
|
|
21
|
-
|
|
89
|
+
horizontal: {
|
|
90
|
+
base: string;
|
|
91
|
+
divider: string;
|
|
92
|
+
};
|
|
93
|
+
vertical: {
|
|
94
|
+
base: string;
|
|
95
|
+
divider: string;
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
}, {
|
|
99
|
+
base: string[];
|
|
100
|
+
divider: string[];
|
|
101
|
+
beforeDivider: string;
|
|
102
|
+
afterDivider: string;
|
|
103
|
+
}, undefined, {
|
|
104
|
+
align: {
|
|
105
|
+
start: {};
|
|
106
|
+
center: {};
|
|
107
|
+
end: {};
|
|
108
|
+
};
|
|
109
|
+
hasChildren: {
|
|
110
|
+
true: {};
|
|
111
|
+
false: {};
|
|
22
112
|
};
|
|
23
|
-
}, undefined, string[], {
|
|
24
113
|
orientation: {
|
|
25
|
-
horizontal:
|
|
26
|
-
|
|
114
|
+
horizontal: {
|
|
115
|
+
base: string;
|
|
116
|
+
divider: string;
|
|
117
|
+
};
|
|
118
|
+
vertical: {
|
|
119
|
+
base: string;
|
|
120
|
+
divider: string;
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
}, {
|
|
124
|
+
base: string[];
|
|
125
|
+
divider: string[];
|
|
126
|
+
beforeDivider: string;
|
|
127
|
+
afterDivider: string;
|
|
128
|
+
}, import('tailwind-variants').TVReturnTypeLike<{
|
|
129
|
+
align: {
|
|
130
|
+
start: {};
|
|
131
|
+
center: {};
|
|
132
|
+
end: {};
|
|
133
|
+
};
|
|
134
|
+
hasChildren: {
|
|
135
|
+
true: {};
|
|
136
|
+
false: {};
|
|
27
137
|
};
|
|
28
|
-
}, undefined, import('tailwind-variants').TVReturnTypeLike<{
|
|
29
138
|
orientation: {
|
|
30
|
-
horizontal:
|
|
31
|
-
|
|
139
|
+
horizontal: {
|
|
140
|
+
base: string;
|
|
141
|
+
divider: string;
|
|
142
|
+
};
|
|
143
|
+
vertical: {
|
|
144
|
+
base: string;
|
|
145
|
+
divider: string;
|
|
146
|
+
};
|
|
32
147
|
};
|
|
33
|
-
},
|
|
148
|
+
}, {
|
|
149
|
+
base: string[];
|
|
150
|
+
divider: string[];
|
|
151
|
+
beforeDivider: string;
|
|
152
|
+
afterDivider: string;
|
|
153
|
+
}>>;
|
|
34
154
|
export default _default;
|
package/dist/Divider/style.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"../styles/theme/index.js";import{tv as t}from"tailwind-variants";var n=(n=e)=>t({base:[`
|
|
1
|
+
import e from"../styles/theme/index.js";import{tv as t}from"tailwind-variants";var n=(n=e)=>t({slots:{base:[`flex items-center gap-1.5`,n.typography.colors.textPrimary,n.typography.variants.body2],divider:[n.divider],beforeDivider:``,afterDivider:``},variants:{align:{start:{},center:{},end:{}},hasChildren:{true:{},false:{}},orientation:{horizontal:{base:`w-full`,divider:`border-t`},vertical:{base:`flex-col h-auto self-stretch`,divider:`border-l`}}},compoundVariants:[{hasChildren:!0,orientation:`horizontal`,align:`start`,class:{beforeDivider:`w-[10%]`,afterDivider:`w-[90%]`}},{hasChildren:!0,orientation:`horizontal`,align:`center`,class:{beforeDivider:`w-[50%]`,afterDivider:`w-[50%]`}},{hasChildren:!0,orientation:`horizontal`,align:`end`,class:{beforeDivider:`w-[90%]`,afterDivider:`w-[10%]`}},{hasChildren:!0,orientation:`vertical`,align:`start`,class:{beforeDivider:`h-[10%]`,afterDivider:`h-[90%]`}},{hasChildren:!0,orientation:`vertical`,align:`center`,class:{beforeDivider:`h-[50%]`,afterDivider:`h-[50%]`}},{hasChildren:!0,orientation:`vertical`,align:`end`,class:{beforeDivider:`h-[90%]`,afterDivider:`h-[10%]`}},{hasChildren:!1,orientation:`horizontal`,class:{beforeDivider:`w-full`}},{hasChildren:!1,orientation:`vertical`,class:{beforeDivider:`h-full`}}]}),r=n();export{r as default,n as divider};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { ValidComponent } from 'solid-js';
|
|
1
2
|
import { ButtonProps } from '../Button';
|
|
2
|
-
export type IconButtonProps = {
|
|
3
|
+
export type IconButtonProps<T extends ValidComponent = "button"> = {
|
|
3
4
|
class?: string;
|
|
4
|
-
} & Omit<ButtonProps
|
|
5
|
-
declare const IconButton: (props: IconButtonProps) => import("solid-js").JSX.Element;
|
|
5
|
+
} & Omit<ButtonProps<T>, "fullWidth" | "startIcon" | "endIcon" | "variant" | "slotProps">;
|
|
6
|
+
declare const IconButton: <T extends ValidComponent = "button">(props: IconButtonProps<T>) => import("solid-js").JSX.Element;
|
|
6
7
|
export default IconButton;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"../utils/cn.js";import t from"./style.js";import{useThemeContext as n}from"../ThemeProvider/ThemeContext.js";import"../ThemeProvider/index.js";import r
|
|
1
|
+
import e from"../utils/cn.js";import t from"./style.js";import{useThemeContext as n}from"../ThemeProvider/ThemeContext.js";import"../ThemeProvider/index.js";import{t as r}from"../_chunks/Button-D7kRTDWq.js";import{createComponent as i,mergeProps as a}from"solid-js/web";import{createMemo as o,mergeProps as s,splitProps as c}from"solid-js";var l=l=>{let u=s({size:`medium`},l),[d,f]=c(u,[`children`,`class`,`size`,`fullWidth`,`startIcon`,`endIcon`,`variant`,`slotProps`]),p=n(),m=o(()=>{let e={size:d.size};return p?p.componentsTV.iconButton(e):t(e)});return i(r,a(f,{get class(){return e(m(),d.class)},fullWidth:!1,variant:`ghost`,get children(){return d.children}}))};export{l as default};
|
package/dist/IconButton/style.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"../styles/theme/index.js";import{tv as t}from"tailwind-variants";var n=(n=e)=>t({base:[`px-0 py-0 min-h-[initial]`,`flex justify-center items-center shrink-0`,n.rounded.full],variants:{size:{small:`size-6 text-lg`,medium:`size-8 text-2xl`,large:`size-10 text-3xl`}}}),r=n();export{r as default,n as iconButton};
|
|
1
|
+
import e from"../styles/theme/index.js";import{tv as t}from"tailwind-variants";var n=(n=e)=>t({base:[`px-0 py-0 min-h-[initial]`,`inline-flex justify-center items-center shrink-0`,n.rounded.full],variants:{size:{small:`size-6 text-lg`,medium:`size-8 text-2xl`,large:`size-10 text-3xl`}}}),r=n();export{r as default,n as iconButton};
|
package/dist/Input/Input.d.ts
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { ComponentProps, JSX } from 'solid-js';
|
|
2
2
|
import { VariantProps } from 'tailwind-variants';
|
|
3
|
+
import { Prettify } from '../types/Prettify';
|
|
4
|
+
import { WithExtendedComponentProps } from '../types/ExtendedComponentProps';
|
|
3
5
|
import { ThemeColors } from '../styles/theme/colors';
|
|
4
6
|
import { default as inputDefaultStyles } from './style';
|
|
5
7
|
type InputVariants = VariantProps<typeof inputDefaultStyles>;
|
|
6
|
-
type InputSlotProps = {
|
|
7
|
-
base?: ComponentProps<"div">;
|
|
8
|
-
prefix?: ComponentProps<"span">;
|
|
9
|
-
suffix?: ComponentProps<"span">;
|
|
10
|
-
}
|
|
8
|
+
type InputSlotProps = Prettify<{
|
|
9
|
+
base?: Prettify<ComponentProps<"div"> & WithExtendedComponentProps>;
|
|
10
|
+
prefix?: Prettify<ComponentProps<"span"> & WithExtendedComponentProps>;
|
|
11
|
+
suffix?: Prettify<ComponentProps<"span"> & WithExtendedComponentProps>;
|
|
12
|
+
}>;
|
|
11
13
|
type InputTypes = "number" | "search" | "time" | "image" | "text" | "color" | "date" | "datetime-local" | "email" | "file" | "month" | "password" | "tel" | "url" | "week";
|
|
12
14
|
export type InputProps = {
|
|
13
15
|
class?: string;
|
package/dist/Input/Input.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"../utils/cn.js";import t from"./style.js";import{useThemeContext as n}from"../ThemeProvider/ThemeContext.js";import"../ThemeProvider/index.js";import{
|
|
1
|
+
import e from"../utils/cn.js";import t from"./style.js";import{useThemeContext as n}from"../ThemeProvider/ThemeContext.js";import"../ThemeProvider/index.js";import"../types/Prettify.js";import"../types/ExtendedComponentProps.js";import{createComponent as r,insert as i,mergeProps as a,spread as o,template as s}from"solid-js/web";import{Show as c,createMemo as l,mergeProps as u,splitProps as d}from"solid-js";import"tailwind-variants";var f=s(`<span>`),p=s(`<div><input>`),m=s=>{let m=u({color:`default`,disabled:!1,variant:`outlined`,size:`medium`,type:`text`},s),[h,g]=d(m,[`class`,`color`,`disabled`,`fullWidth`,`inputSize`,`prefix`,`size`,`slotProps`,`suffix`,`type`,`variant`,`children`]),_=n(),v=l(()=>{let e={color:h.color,disabled:h.disabled,variant:h.variant,size:h.size,fullWidth:h.fullWidth};return _?_.componentsTV.input(e):t(e)});return(()=>{var t=p(),n=t.firstChild;return o(t,a(()=>h.slotProps?.base,{get class(){return e(v().base(),h.slotProps?.base?.class)}}),!1,!0),i(t,r(c,{get when(){return h.prefix},get children(){var t=f();return o(t,a(()=>h.slotProps?.prefix,{get class(){return e(v().prefix(),h.slotProps?.prefix?.class)}}),!1,!0),i(t,()=>h.prefix),t}}),n),o(n,a(g,{get type(){return h.type},get disabled(){return h.disabled},get size(){return h.inputSize},get class(){return e(v().input(),h.class)}}),!1,!1),i(t,r(c,{get when(){return h.suffix},get children(){var t=f();return o(t,a(()=>h.slotProps?.suffix,{get class(){return e(v().suffix(),h.slotProps?.suffix?.class)}}),!1,!0),i(t,()=>h.suffix),t}}),null),t})()};export{m as default};
|
package/dist/Input/style.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"../styles/theme/index.js";import t from"../utils/asVariant.js";import n from"../utils/typedKeys.js";import{tv as r}from"tailwind-variants";var i=[`filled`,`outlined`,`ghost`],a=(a=e)=>r({slots:{base:[`inline-flex items-center overflow-hidden`,a.rounded.small,a.focusWithin],input:[`w-full h-full border-0 outline-0`],prefix:`leading-1 shrink-0 ps-1.5 pe-1`,suffix:`leading-1 shrink-0 ps-1 pe-1.5`},variants:{color:t(a.colors,()=>``),disabled:{true:{},false:{}},fullWidth:{true:{base:`w-full`},false:{}},size:{small:{base:`h-6 text-sm`,input:`py-1 px-1.5`},medium:{base:`h-8 text-sm`,input:`py-1 px-1.5`},large:{base:`h-10 text-md`,input:`py-1.5 px-2`}},variant:{filled:{},ghost:{},outlined:{base:`border border-1`}}},compoundVariants:[...n(a.colors).flatMap(e=>i.flatMap(t=>{let n=a.colors[e][t];return[{color:e,disabled:!1,variant:t,class:{base:[n.background,n.border,n.text],prefix:[n.text],suffix:[n.text]}},{color:e,disabled:!0,variant:t,class:{base:[t===`filled`?a.disabled.background:``,t===`outlined`?a.disabled.border:``,a.disabled.text],prefix:[a.disabled.text],suffix:[a.disabled.text]}}]}))]}),o=a();export{o as default,a as input};
|
|
1
|
+
import e from"../styles/theme/index.js";import t from"../utils/asVariant.js";import n from"../utils/typedKeys.js";import{tv as r}from"tailwind-variants";var i=[`filled`,`outlined`,`ghost`],a=(a=e)=>r({slots:{base:[`inline-flex items-center overflow-hidden`,a.rounded.small,a.focusWithin],input:[`w-full h-full border-0 outline-0`],prefix:`leading-[1] shrink-0 ps-1.5 pe-1`,suffix:`leading-[1] shrink-0 ps-1 pe-1.5`},variants:{color:t(a.colors,()=>``),disabled:{true:{},false:{}},fullWidth:{true:{base:`w-full`},false:{}},size:{small:{base:`h-6 text-sm`,input:`py-1 px-1.5`},medium:{base:`h-8 text-sm`,input:`py-1 px-1.5`},large:{base:`h-10 text-md`,input:`py-1.5 px-2`}},variant:{filled:{},ghost:{},outlined:{base:`border border-1`}}},compoundVariants:[...n(a.colors).flatMap(e=>i.flatMap(t=>{let n=a.colors[e][t];return[{color:e,disabled:!1,variant:t,class:{base:[n.background,n.border,n.text],prefix:[n.text],suffix:[n.text]}},{color:e,disabled:!0,variant:t,class:{base:[t===`filled`?a.disabled.background:``,t===`outlined`?a.disabled.border:``,a.disabled.text],prefix:[a.disabled.text],suffix:[a.disabled.text]}}]}))]}),o=a();export{o as default,a as input};
|
package/dist/Link/style.d.ts
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
1
|
import { Theme } from '../styles/theme';
|
|
2
2
|
export declare const link: (theme?: Theme) => import('tailwind-variants').TVReturnType<{
|
|
3
3
|
underline: {
|
|
4
|
-
none: "";
|
|
4
|
+
none: "no-underline";
|
|
5
5
|
hover: "hover:underline";
|
|
6
6
|
always: "underline";
|
|
7
7
|
};
|
|
8
8
|
}, undefined, string[], {
|
|
9
9
|
underline: {
|
|
10
|
-
none: "";
|
|
10
|
+
none: "no-underline";
|
|
11
11
|
hover: "hover:underline";
|
|
12
12
|
always: "underline";
|
|
13
13
|
};
|
|
14
14
|
}, undefined, import('tailwind-variants').TVReturnTypeLike<{
|
|
15
15
|
underline: {
|
|
16
|
-
none: "";
|
|
16
|
+
none: "no-underline";
|
|
17
17
|
hover: "hover:underline";
|
|
18
18
|
always: "underline";
|
|
19
19
|
};
|
|
20
20
|
}, undefined>>;
|
|
21
21
|
declare const _default: import('tailwind-variants').TVReturnType<{
|
|
22
22
|
underline: {
|
|
23
|
-
none: "";
|
|
23
|
+
none: "no-underline";
|
|
24
24
|
hover: "hover:underline";
|
|
25
25
|
always: "underline";
|
|
26
26
|
};
|
|
27
27
|
}, undefined, string[], {
|
|
28
28
|
underline: {
|
|
29
|
-
none: "";
|
|
29
|
+
none: "no-underline";
|
|
30
30
|
hover: "hover:underline";
|
|
31
31
|
always: "underline";
|
|
32
32
|
};
|
|
33
33
|
}, undefined, import('tailwind-variants').TVReturnTypeLike<{
|
|
34
34
|
underline: {
|
|
35
|
-
none: "";
|
|
35
|
+
none: "no-underline";
|
|
36
36
|
hover: "hover:underline";
|
|
37
37
|
always: "underline";
|
|
38
38
|
};
|
package/dist/Link/style.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"../styles/theme/index.js";import{tv as t}from"tailwind-variants";var n=(n=e)=>t({base:[`block`,n.rounded.small,n.focus],variants:{underline:{none
|
|
1
|
+
import e from"../styles/theme/index.js";import{tv as t}from"tailwind-variants";var n=(n=e)=>t({base:[`block`,n.rounded.small,n.focus],variants:{underline:{none:`no-underline`,hover:`hover:underline`,always:`underline`}}}),r=n();export{r as default,n as link};
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { ComponentProps, JSX } from 'solid-js';
|
|
2
2
|
import { VariantProps } from 'tailwind-variants';
|
|
3
|
+
import { Prettify } from '../types/Prettify';
|
|
4
|
+
import { WithExtendedComponentProps } from '../types/ExtendedComponentProps';
|
|
3
5
|
import { ThemeColors } from '../styles/theme/colors';
|
|
4
6
|
import { default as progressDefaultStyles } from './style';
|
|
5
7
|
type ProgressVariants = VariantProps<typeof progressDefaultStyles>;
|
|
6
|
-
type ProgressSlotProps = {
|
|
7
|
-
fill?: {
|
|
8
|
+
type ProgressSlotProps = Prettify<{
|
|
9
|
+
fill?: Prettify<{
|
|
8
10
|
style?: JSX.CSSProperties;
|
|
9
|
-
} & Omit<ComponentProps<"span">, "style">;
|
|
10
|
-
}
|
|
11
|
+
} & Omit<ComponentProps<"span">, "style"> & WithExtendedComponentProps>;
|
|
12
|
+
}>;
|
|
11
13
|
export type ProgressProps = {
|
|
12
14
|
class?: string;
|
|
13
15
|
color?: keyof ThemeColors;
|
|
@@ -16,6 +18,6 @@ export type ProgressProps = {
|
|
|
16
18
|
value?: number;
|
|
17
19
|
size?: ProgressVariants["size"];
|
|
18
20
|
slotProps?: ProgressSlotProps;
|
|
19
|
-
} &
|
|
21
|
+
} & ComponentProps<"div">;
|
|
20
22
|
declare const Progress: (props: ProgressProps) => JSX.Element;
|
|
21
23
|
export default Progress;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"../utils/cn.js";import t from"./style.js";import{useThemeContext as n}from"../ThemeProvider/ThemeContext.js";import"../ThemeProvider/index.js";import{mergeProps as r,spread as i,template as a}from"solid-js/web";import{createMemo as o,mergeProps as s,splitProps as c}from"solid-js";import"tailwind-variants";var l=a(`<div role=progressbar><span>`),u=a=>{let u=s({color:`default`,max:100,min:0,size:`medium`},a),[d,f]=c(u,[`color`,`class`,`max`,`min`,`slotProps`,`size`,`value`,`children`]),p=n(),m=o(()=>{let e=d.min,t=d.max,n=d.value;return Math.min(100,Math.max(0,(n-e)/(t-e)*100))}),h=o(()=>{let e={color:d.color,size:d.size};return p?p.componentsTV.progress(e):t(e)});return(()=>{var t=l(),n=t.firstChild;return i(t,r({get"aria-valuemax"(){return d.max},get"aria-valuemin"(){return d.min},get"aria-valuenow"(){return d.value}},f,{get class(){return e(h().base(),d.class)}}),!1,!0),i(n,r(()=>d.slotProps?.fill,{get class(){return e(h().fill(),d.slotProps?.fill?.class)},get style(){return{...d.slotProps?.fill?.style,width:`${m()}%`}}}),!1,!1),t})()};export{u as default};
|
|
1
|
+
import e from"../utils/cn.js";import t from"./style.js";import{useThemeContext as n}from"../ThemeProvider/ThemeContext.js";import"../ThemeProvider/index.js";import"../types/Prettify.js";import"../types/ExtendedComponentProps.js";import{mergeProps as r,spread as i,template as a}from"solid-js/web";import{createMemo as o,mergeProps as s,splitProps as c}from"solid-js";import"tailwind-variants";var l=a(`<div role=progressbar><span>`),u=a=>{let u=s({color:`default`,max:100,min:0,value:0,size:`medium`},a),[d,f]=c(u,[`color`,`class`,`max`,`min`,`slotProps`,`size`,`value`,`children`]),p=n(),m=o(()=>{let e=d.min,t=d.max,n=d.value;return Math.min(100,Math.max(0,(n-e)/(t-e)*100))}),h=o(()=>{let e={color:d.color,size:d.size};return p?p.componentsTV.progress(e):t(e)});return(()=>{var t=l(),n=t.firstChild;return i(t,r({get"aria-valuemax"(){return d.max},get"aria-valuemin"(){return d.min},get"aria-valuenow"(){return d.value}},f,{get class(){return e(h().base(),d.class)}}),!1,!0),i(n,r(()=>d.slotProps?.fill,{get class(){return e(h().fill(),d.slotProps?.fill?.class)},get style(){return{...d.slotProps?.fill?.style,width:`${m()}%`}}}),!1,!1),t})()};export{u as default};
|
package/dist/Progress/style.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"../styles/theme/index.js";import t from"../utils/asVariant.js";import{tv as n}from"tailwind-variants";var r=(r=e)=>n({slots:{base:[`block w-full overflow-hidden`,`bg-neutral-300 dark:bg-neutral-700`,r.rounded.
|
|
1
|
+
import e from"../styles/theme/index.js";import t from"../utils/asVariant.js";import{tv as n}from"tailwind-variants";var r=(r=e)=>n({slots:{base:[`block w-full overflow-hidden`,`bg-neutral-300 dark:bg-neutral-700`,r.rounded.full],fill:[`block h-full rounded-[inherit]`,`transition-[width] duration-150`]},variants:{color:t(r.colors,e=>({fill:[e.solid.background]})),size:{small:{base:`h-1`},medium:{base:`h-2`},large:{base:`h-4`}}}}),i=r();export{i as default,r as progress};
|
package/dist/Radio/Radio.d.ts
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import { ComponentProps } from 'solid-js';
|
|
1
|
+
import { ComponentProps, JSXElement } from 'solid-js';
|
|
2
|
+
import { Prettify } from '../types/Prettify';
|
|
3
|
+
import { WithExtendedComponentProps } from '../types/ExtendedComponentProps';
|
|
2
4
|
import { IconButtonProps } from '../IconButton';
|
|
3
|
-
type RadioSlotProps = {
|
|
4
|
-
base?: ComponentProps<"span">;
|
|
5
|
-
}
|
|
5
|
+
type RadioSlotProps = Prettify<{
|
|
6
|
+
base?: Prettify<ComponentProps<"span"> & WithExtendedComponentProps>;
|
|
7
|
+
}>;
|
|
6
8
|
export type RadioProps = {
|
|
7
9
|
class?: string;
|
|
8
10
|
checked?: boolean;
|
|
11
|
+
checkedIcon?: JSXElement;
|
|
9
12
|
color?: IconButtonProps["color"];
|
|
10
13
|
defaultChecked?: boolean;
|
|
11
14
|
disabled?: boolean;
|
|
@@ -13,6 +16,7 @@ export type RadioProps = {
|
|
|
13
16
|
onChange?: (event: Event) => void;
|
|
14
17
|
size?: IconButtonProps["size"];
|
|
15
18
|
slotProps?: RadioSlotProps;
|
|
19
|
+
uncheckedIcon?: JSXElement;
|
|
16
20
|
value?: string;
|
|
17
21
|
} & Omit<ComponentProps<"input">, "type">;
|
|
18
22
|
declare const Radio: (props: RadioProps) => import("solid-js").JSX.Element;
|