@pathscale/ui 1.1.34 → 1.1.35
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/components/button/Button.css +10 -1
- package/dist/components/button/Button.d.ts +2 -0
- package/dist/components/button/Button.js +31 -6
- package/dist/components/button-group/ButtonGroup.css +117 -0
- package/dist/components/button-group/ButtonGroup.d.ts +23 -0
- package/dist/components/button-group/ButtonGroup.js +91 -0
- package/dist/components/button-group/context.d.ts +8 -0
- package/dist/components/button-group/context.js +3 -0
- package/dist/components/button-group/index.d.ts +1 -0
- package/dist/components/button-group/index.js +6 -0
- package/dist/components/card/Card.css +110 -0
- package/dist/components/card/Card.d.ts +26 -26
- package/dist/components/card/Card.js +131 -70
- package/dist/components/card/index.d.ts +1 -1
- package/dist/components/card/index.js +6 -1
- package/dist/components/checkbox/Checkbox.js +18 -4
- package/dist/components/checkbox-group/CheckboxGroup.css +10 -0
- package/dist/components/checkbox-group/CheckboxGroup.d.ts +18 -0
- package/dist/components/checkbox-group/CheckboxGroup.js +97 -0
- package/dist/components/checkbox-group/context.d.ts +11 -0
- package/dist/components/checkbox-group/context.js +3 -0
- package/dist/components/checkbox-group/index.d.ts +4 -0
- package/dist/components/checkbox-group/index.js +4 -0
- package/dist/components/chip/Chip.css +11 -9
- package/dist/components/chip/Chip.d.ts +2 -2
- package/dist/components/chip/Chip.js +38 -30
- package/dist/components/close-button/CloseButton.css +81 -0
- package/dist/components/close-button/CloseButton.d.ts +14 -0
- package/dist/components/close-button/CloseButton.js +76 -0
- package/dist/components/close-button/index.d.ts +1 -0
- package/dist/components/close-button/index.js +3 -0
- package/dist/components/combo-box/ComboBox.css +344 -0
- package/dist/components/combo-box/ComboBox.d.ts +86 -0
- package/dist/components/combo-box/ComboBox.js +708 -0
- package/dist/components/combo-box/index.d.ts +1 -0
- package/dist/components/combo-box/index.js +10 -0
- package/dist/components/date-field/DateField.css +215 -0
- package/dist/components/date-field/DateField.d.ts +64 -0
- package/dist/components/date-field/DateField.js +341 -0
- package/dist/components/date-field/index.d.ts +1 -0
- package/dist/components/date-field/index.js +11 -0
- package/dist/components/description/Description.css +10 -0
- package/dist/components/description/Description.d.ts +11 -0
- package/dist/components/{form/Label.js → description/Description.js} +23 -14
- package/dist/components/description/index.d.ts +1 -0
- package/dist/components/description/index.js +5 -0
- package/dist/components/drawer/Drawer.css +15 -0
- package/dist/components/drawer/Drawer.d.ts +2 -0
- package/dist/components/drawer/Drawer.js +24 -16
- package/dist/components/error-message/ErrorMessage.css +20 -0
- package/dist/components/error-message/ErrorMessage.d.ts +11 -0
- package/dist/components/error-message/ErrorMessage.js +40 -0
- package/dist/components/error-message/index.d.ts +1 -0
- package/dist/components/error-message/index.js +5 -0
- package/dist/components/field-error/FieldError.css +27 -0
- package/dist/components/field-error/FieldError.d.ts +21 -0
- package/dist/components/field-error/FieldError.js +69 -0
- package/dist/components/field-error/index.d.ts +1 -0
- package/dist/components/field-error/index.js +5 -0
- package/dist/components/fieldset/Fieldset.css +30 -0
- package/dist/components/fieldset/Fieldset.d.ts +22 -9
- package/dist/components/fieldset/Fieldset.js +88 -44
- package/dist/components/fieldset/index.d.ts +1 -2
- package/dist/components/fieldset/index.js +7 -2
- package/dist/components/form/Form.css +5 -0
- package/dist/components/form/Form.d.ts +10 -16
- package/dist/components/form/Form.js +33 -16
- package/dist/components/form/index.d.ts +1 -4
- package/dist/components/form/index.js +3 -4
- package/dist/components/header/Header.css +13 -0
- package/dist/components/header/Header.d.ts +9 -0
- package/dist/components/{menu/MenuDetails.js → header/Header.js} +17 -20
- package/dist/components/header/index.d.ts +1 -0
- package/dist/components/header/index.js +5 -0
- package/dist/components/immersive-landing/components/FirefoxPWABanner.js +62 -68
- package/dist/components/immersive-landing/components/PWAInstallPrompt.js +58 -64
- package/dist/components/input/Input.css +3 -2
- package/dist/components/input/Input.d.ts +2 -2
- package/dist/components/input/Input.js +7 -7
- package/dist/components/input-group/InputGroup.css +172 -0
- package/dist/components/input-group/InputGroup.d.ts +44 -0
- package/dist/components/input-group/InputGroup.js +227 -0
- package/dist/components/input-group/index.d.ts +1 -0
- package/dist/components/input-group/index.js +9 -0
- package/dist/components/input-otp/InputOTP.css +170 -0
- package/dist/components/input-otp/InputOTP.d.ts +46 -0
- package/dist/components/input-otp/InputOTP.js +385 -0
- package/dist/components/input-otp/index.d.ts +1 -0
- package/dist/components/input-otp/index.js +11 -0
- package/dist/components/label/Label.css +30 -0
- package/dist/components/label/Label.d.ts +17 -0
- package/dist/components/label/Label.js +64 -0
- package/dist/components/label/index.d.ts +1 -0
- package/dist/components/label/index.js +5 -0
- package/dist/components/list-box/ListBox.css +148 -0
- package/dist/components/list-box/ListBox.d.ts +23 -0
- package/dist/components/list-box/ListBox.js +224 -0
- package/dist/components/list-box/ListBoxItem.d.ts +28 -0
- package/dist/components/list-box/ListBoxItem.js +231 -0
- package/dist/components/list-box/ListBoxSection.d.ts +11 -0
- package/dist/components/list-box/ListBoxSection.js +48 -0
- package/dist/components/list-box/context.d.ts +27 -0
- package/dist/components/list-box/context.js +3 -0
- package/dist/components/list-box/index.d.ts +17 -0
- package/dist/components/list-box/index.js +17 -0
- package/dist/components/menu/Menu.css +199 -0
- package/dist/components/menu/Menu.d.ts +32 -20
- package/dist/components/menu/Menu.js +213 -39
- package/dist/components/menu/MenuItem.d.ts +35 -5
- package/dist/components/menu/MenuItem.js +270 -19
- package/dist/components/menu/MenuSection.d.ts +11 -0
- package/dist/components/menu/MenuSection.js +48 -0
- package/dist/components/menu/context.d.ts +26 -0
- package/dist/components/menu/context.js +3 -0
- package/dist/components/menu/index.d.ts +4 -3
- package/dist/components/menu/index.js +11 -2
- package/dist/components/number-field/NumberField.css +198 -0
- package/dist/components/number-field/NumberField.d.ts +48 -0
- package/dist/components/number-field/NumberField.js +350 -0
- package/dist/components/number-field/index.d.ts +1 -0
- package/dist/components/number-field/index.js +9 -0
- package/dist/components/search-field/SearchField.css +183 -0
- package/dist/components/search-field/SearchField.d.ts +53 -0
- package/dist/components/search-field/SearchField.js +303 -0
- package/dist/components/search-field/index.d.ts +1 -0
- package/dist/components/search-field/index.js +9 -0
- package/dist/components/select/Select.css +16 -10
- package/dist/components/select/Select.d.ts +10 -2
- package/dist/components/select/Select.js +119 -33
- package/dist/components/separator/Separator.css +35 -0
- package/dist/components/separator/Separator.d.ts +12 -0
- package/dist/components/separator/Separator.js +57 -0
- package/dist/components/separator/index.d.ts +1 -0
- package/dist/components/separator/index.js +4 -0
- package/dist/components/sidenav/Sidenav.js +2 -2
- package/dist/components/surface/Surface.css +37 -0
- package/dist/components/surface/Surface.d.ts +12 -0
- package/dist/components/surface/Surface.js +41 -0
- package/dist/components/surface/index.d.ts +1 -0
- package/dist/components/surface/index.js +4 -0
- package/dist/components/table/hooks/index.d.ts +1 -9
- package/dist/components/table/hooks/index.js +1 -18
- package/dist/components/tag/Tag.css +121 -0
- package/dist/components/tag/Tag.d.ts +33 -0
- package/dist/components/tag/Tag.js +241 -0
- package/dist/components/tag/index.d.ts +1 -0
- package/dist/components/tag/index.js +6 -0
- package/dist/components/tag-group/TagGroup.css +22 -0
- package/dist/components/tag-group/TagGroup.d.ts +32 -0
- package/dist/components/tag-group/TagGroup.js +177 -0
- package/dist/components/tag-group/context.d.ts +15 -0
- package/dist/components/tag-group/context.js +3 -0
- package/dist/components/tag-group/index.d.ts +2 -0
- package/dist/components/tag-group/index.js +6 -0
- package/dist/components/text/Text.css +66 -0
- package/dist/components/text/Text.d.ts +17 -0
- package/dist/components/text/Text.js +46 -0
- package/dist/components/text/index.d.ts +1 -0
- package/dist/components/text/index.js +5 -0
- package/dist/components/text-area/TextArea.css +95 -0
- package/dist/components/text-area/TextArea.d.ts +19 -0
- package/dist/components/text-area/TextArea.js +64 -0
- package/dist/components/text-area/index.d.ts +1 -0
- package/dist/components/text-area/index.js +5 -0
- package/dist/components/text-field/TextField.css +33 -0
- package/dist/components/text-field/TextField.d.ts +34 -0
- package/dist/components/text-field/TextField.js +85 -0
- package/dist/components/text-field/index.d.ts +1 -0
- package/dist/components/text-field/index.js +7 -0
- package/dist/components/textarea/Textarea.d.ts +8 -13
- package/dist/components/textarea/Textarea.js +14 -45
- package/dist/components/textarea/index.d.ts +2 -1
- package/dist/components/textarea/index.js +4 -1
- package/dist/components/time-field/TimeField.css +215 -0
- package/dist/components/time-field/TimeField.d.ts +64 -0
- package/dist/components/time-field/TimeField.js +341 -0
- package/dist/components/time-field/index.d.ts +1 -0
- package/dist/components/time-field/index.js +11 -0
- package/dist/components/utils.d.ts +2 -2
- package/dist/components/utils.js +3 -17
- package/dist/hooks/form/index.d.ts +5 -0
- package/dist/hooks/form/index.js +12 -0
- package/dist/hooks/form/useField.d.ts +11 -0
- package/dist/hooks/form/useField.js +20 -0
- package/dist/hooks/form/useFieldError.d.ts +3 -0
- package/dist/hooks/form/useFieldError.js +3 -0
- package/dist/hooks/form/useFieldMeta.d.ts +20 -0
- package/dist/hooks/form/useFieldMeta.js +49 -0
- package/dist/hooks/form/useFieldProps.d.ts +10 -0
- package/dist/hooks/form/useFieldProps.js +51 -0
- package/dist/hooks/form/useForm.d.ts +27 -0
- package/dist/hooks/form/useForm.js +54 -0
- package/dist/hooks/form/utils.d.ts +4 -0
- package/dist/hooks/form/utils.js +30 -0
- package/dist/hooks/layout/index.d.ts +1 -0
- package/dist/hooks/layout/index.js +3 -0
- package/dist/hooks/layout/useDesktop.d.ts +1 -0
- package/dist/hooks/layout/useDesktop.js +17 -0
- package/dist/hooks/table/index.d.ts +9 -0
- package/dist/hooks/table/index.js +18 -0
- package/dist/index.d.ts +59 -7
- package/dist/index.js +140 -15
- package/dist/styles/icons/generated-icons.css +1 -1
- package/package.json +1 -1
- package/dist/components/card/CardActions.d.ts +0 -4
- package/dist/components/card/CardActions.js +0 -15
- package/dist/components/card/CardBody.d.ts +0 -4
- package/dist/components/card/CardBody.js +0 -15
- package/dist/components/card/CardImage.d.ts +0 -3
- package/dist/components/card/CardImage.js +0 -10
- package/dist/components/card/CardTitle.d.ts +0 -6
- package/dist/components/card/CardTitle.js +0 -13
- package/dist/components/card/card.css +0 -171
- package/dist/components/form/FormBase.d.ts +0 -8
- package/dist/components/form/FormBase.js +0 -74
- package/dist/components/form/FormDropdown.d.ts +0 -25
- package/dist/components/form/FormDropdown.js +0 -139
- package/dist/components/form/FormField.d.ts +0 -14
- package/dist/components/form/FormField.js +0 -78
- package/dist/components/form/Label.d.ts +0 -7
- package/dist/components/form/NumberField.d.ts +0 -20
- package/dist/components/form/NumberField.js +0 -109
- package/dist/components/form/PasswordField.d.ts +0 -16
- package/dist/components/form/PasswordField.js +0 -113
- package/dist/components/form/ValidatedForm.d.ts +0 -26
- package/dist/components/form/ValidatedForm.js +0 -55
- package/dist/components/menu/MenuDetails.d.ts +0 -8
- package/dist/components/menu/MenuDropdown.d.ts +0 -12
- package/dist/components/menu/MenuDropdown.js +0 -48
- package/dist/components/menu/MenuTitle.d.ts +0 -8
- package/dist/components/menu/MenuTitle.js +0 -22
- package/dist/components/menu/menu.css +0 -364
- package/dist/components/textarea/textarea.css +0 -191
- /package/dist/{components/table/hooks → hooks/table}/helpers.d.ts +0 -0
- /package/dist/{components/table/hooks → hooks/table}/helpers.js +0 -0
- /package/dist/{components/table/hooks → hooks/table}/useAnchoredOverlayPosition.d.ts +0 -0
- /package/dist/{components/table/hooks → hooks/table}/useAnchoredOverlayPosition.js +0 -0
- /package/dist/{components/table/hooks → hooks/table}/useTableExpansion.d.ts +0 -0
- /package/dist/{components/table/hooks → hooks/table}/useTableExpansion.js +0 -0
- /package/dist/{components/table/hooks → hooks/table}/useTableFiltering.d.ts +0 -0
- /package/dist/{components/table/hooks → hooks/table}/useTableFiltering.js +0 -0
- /package/dist/{components/table/hooks → hooks/table}/useTableModel.d.ts +0 -0
- /package/dist/{components/table/hooks → hooks/table}/useTableModel.js +0 -0
- /package/dist/{components/table/hooks → hooks/table}/useTablePagination.d.ts +0 -0
- /package/dist/{components/table/hooks → hooks/table}/useTablePagination.js +0 -0
- /package/dist/{components/table/hooks → hooks/table}/useTableSelection.d.ts +0 -0
- /package/dist/{components/table/hooks → hooks/table}/useTableSelection.js +0 -0
- /package/dist/{components/table/hooks → hooks/table}/useTableSorting.d.ts +0 -0
- /package/dist/{components/table/hooks → hooks/table}/useTableSorting.js +0 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
@layer components {
|
|
2
|
+
.separator {
|
|
3
|
+
display: block;
|
|
4
|
+
flex-shrink: 0;
|
|
5
|
+
border-radius: 0.25rem;
|
|
6
|
+
|
|
7
|
+
--separator-color: var(--color-separator, var(--color-base-300));
|
|
8
|
+
|
|
9
|
+
background-color: var(--separator-color);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.separator--horizontal {
|
|
13
|
+
width: 100%;
|
|
14
|
+
height: 1px;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.separator--vertical {
|
|
18
|
+
width: 1px;
|
|
19
|
+
height: auto;
|
|
20
|
+
min-height: 0.5rem;
|
|
21
|
+
align-self: stretch;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.separator--default {
|
|
25
|
+
--separator-color: var(--color-separator, var(--color-base-300));
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.separator--secondary {
|
|
29
|
+
--separator-color: var(--color-separator-secondary, var(--color-base-300));
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.separator--tertiary {
|
|
33
|
+
--separator-color: var(--color-separator-tertiary, var(--color-base-200));
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import "./Separator.css";
|
|
2
|
+
import { type Component, type JSX } from "solid-js";
|
|
3
|
+
import type { IComponentBaseProps } from "../types";
|
|
4
|
+
export type SeparatorOrientation = "horizontal" | "vertical";
|
|
5
|
+
export type SeparatorVariant = "default" | "secondary" | "tertiary";
|
|
6
|
+
export type SeparatorProps = Omit<JSX.HTMLAttributes<HTMLDivElement>, "children"> & IComponentBaseProps & {
|
|
7
|
+
orientation?: SeparatorOrientation;
|
|
8
|
+
variant?: SeparatorVariant;
|
|
9
|
+
};
|
|
10
|
+
declare const Separator: Component<SeparatorProps>;
|
|
11
|
+
export default Separator;
|
|
12
|
+
export { Separator };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import * as __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__ from "solid-js/web";
|
|
2
|
+
import "./Separator.css";
|
|
3
|
+
import * as __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__ from "solid-js";
|
|
4
|
+
import * as __WEBPACK_EXTERNAL_MODULE_tailwind_merge_e05e3e95__ from "tailwind-merge";
|
|
5
|
+
var _tmpl$ = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<div>");
|
|
6
|
+
const ORIENTATION_CLASS = {
|
|
7
|
+
horizontal: "separator--horizontal",
|
|
8
|
+
vertical: "separator--vertical"
|
|
9
|
+
};
|
|
10
|
+
const VARIANT_CLASS = {
|
|
11
|
+
default: "separator--default",
|
|
12
|
+
secondary: "separator--secondary",
|
|
13
|
+
tertiary: "separator--tertiary"
|
|
14
|
+
};
|
|
15
|
+
const Separator_Separator = (props)=>{
|
|
16
|
+
const [local, others] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.splitProps)(props, [
|
|
17
|
+
"class",
|
|
18
|
+
"className",
|
|
19
|
+
"dataTheme",
|
|
20
|
+
"style",
|
|
21
|
+
"orientation",
|
|
22
|
+
"variant",
|
|
23
|
+
"role"
|
|
24
|
+
]);
|
|
25
|
+
const orientation = ()=>local.orientation ?? "horizontal";
|
|
26
|
+
const variant = ()=>local.variant ?? "default";
|
|
27
|
+
return (()=>{
|
|
28
|
+
var _el$ = _tmpl$();
|
|
29
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.spread)(_el$, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.mergeProps)(others, {
|
|
30
|
+
get role () {
|
|
31
|
+
return local.role ?? "separator";
|
|
32
|
+
},
|
|
33
|
+
get ["aria-orientation"] () {
|
|
34
|
+
return orientation();
|
|
35
|
+
},
|
|
36
|
+
"data-slot": "separator",
|
|
37
|
+
get ["data-orientation"] () {
|
|
38
|
+
return orientation();
|
|
39
|
+
},
|
|
40
|
+
get ["data-variant"] () {
|
|
41
|
+
return variant();
|
|
42
|
+
},
|
|
43
|
+
get ["class"] () {
|
|
44
|
+
return (0, __WEBPACK_EXTERNAL_MODULE_tailwind_merge_e05e3e95__.twMerge)("separator", ORIENTATION_CLASS[orientation()], VARIANT_CLASS[variant()], local.class, local.className);
|
|
45
|
+
},
|
|
46
|
+
get ["data-theme"] () {
|
|
47
|
+
return local.dataTheme;
|
|
48
|
+
},
|
|
49
|
+
get style () {
|
|
50
|
+
return local.style;
|
|
51
|
+
}
|
|
52
|
+
}), false, false);
|
|
53
|
+
return _el$;
|
|
54
|
+
})();
|
|
55
|
+
};
|
|
56
|
+
const Separator = Separator_Separator;
|
|
57
|
+
export { Separator_Separator as Separator, Separator as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default, Separator, type SeparatorProps, type SeparatorOrientation, type SeparatorVariant, } from "./Separator";
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import * as __WEBPACK_EXTERNAL_MODULE__Separator_js_c4a9d2eb__ from "./Separator.js";
|
|
2
|
+
var __webpack_exports__Separator = __WEBPACK_EXTERNAL_MODULE__Separator_js_c4a9d2eb__.Separator;
|
|
3
|
+
var __webpack_exports__default = __WEBPACK_EXTERNAL_MODULE__Separator_js_c4a9d2eb__["default"];
|
|
4
|
+
export { __webpack_exports__Separator as Separator, __webpack_exports__default as default };
|
|
@@ -2,7 +2,7 @@ import * as __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__ from "solid-js/web
|
|
|
2
2
|
import * as __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__ from "solid-js";
|
|
3
3
|
import * as __WEBPACK_EXTERNAL_MODULE_tailwind_merge_e05e3e95__ from "tailwind-merge";
|
|
4
4
|
import * as __WEBPACK_EXTERNAL_MODULE_clsx__ from "clsx";
|
|
5
|
-
import * as
|
|
5
|
+
import * as __WEBPACK_EXTERNAL_MODULE__hooks_layout_index_js_5ce0ec95__ from "../../hooks/layout/index.js";
|
|
6
6
|
var _tmpl$ = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<div class=sidenav-header><h2 class=sidenav-title>"), _tmpl$2 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<div class=sidenav-footer>"), _tmpl$3 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<nav><div class=sidenav-content>");
|
|
7
7
|
const Sidenav = (props)=>{
|
|
8
8
|
const [local, others] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.splitProps)(props, [
|
|
@@ -19,7 +19,7 @@ const Sidenav = (props)=>{
|
|
|
19
19
|
"desktopBreakpoint"
|
|
20
20
|
]);
|
|
21
21
|
const resolvedChildren = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.children)(()=>local.children);
|
|
22
|
-
const isDesktop = (0,
|
|
22
|
+
const isDesktop = (0, __WEBPACK_EXTERNAL_MODULE__hooks_layout_index_js_5ce0ec95__.useDesktop)(local.desktopBreakpoint || 1024);
|
|
23
23
|
const classes = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createMemo)(()=>(0, __WEBPACK_EXTERNAL_MODULE_tailwind_merge_e05e3e95__.twMerge)("sidenav", local.class, local.className, (0, __WEBPACK_EXTERNAL_MODULE_clsx__.clsx)({
|
|
24
24
|
"sidenav-collapsed": local.collapsed,
|
|
25
25
|
"sidenav-closed": !local.isOpen,
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
@layer components {
|
|
2
|
+
.surface {
|
|
3
|
+
position: relative;
|
|
4
|
+
--surface-bg: var(--color-surface, var(--color-base-100));
|
|
5
|
+
--surface-fg: var(--color-surface-foreground, var(--color-base-content));
|
|
6
|
+
--surface-border: transparent;
|
|
7
|
+
--surface-radius: var(--radius-box, 0.75rem);
|
|
8
|
+
background-color: var(--surface-bg);
|
|
9
|
+
color: var(--surface-fg);
|
|
10
|
+
border: 1px solid var(--surface-border);
|
|
11
|
+
border-radius: var(--surface-radius);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.surface--transparent {
|
|
15
|
+
--surface-bg: transparent;
|
|
16
|
+
--surface-fg: var(--color-foreground, var(--color-base-content));
|
|
17
|
+
--surface-border: transparent;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.surface--default {
|
|
21
|
+
--surface-bg: var(--color-surface, var(--color-base-100));
|
|
22
|
+
--surface-fg: var(--color-surface-foreground, var(--color-base-content));
|
|
23
|
+
--surface-border: transparent;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.surface--secondary {
|
|
27
|
+
--surface-bg: var(--color-surface-secondary, var(--color-base-200));
|
|
28
|
+
--surface-fg: var(--color-surface-secondary-foreground, var(--color-base-content));
|
|
29
|
+
--surface-border: transparent;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.surface--tertiary {
|
|
33
|
+
--surface-bg: var(--color-surface-tertiary, var(--color-base-300));
|
|
34
|
+
--surface-fg: var(--color-surface-tertiary-foreground, var(--color-base-content));
|
|
35
|
+
--surface-border: transparent;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import "./Surface.css";
|
|
2
|
+
import { type JSX } from "solid-js";
|
|
3
|
+
import type { IComponentBaseProps } from "../types";
|
|
4
|
+
export type SurfaceVariant = "default" | "secondary" | "tertiary" | "transparent";
|
|
5
|
+
export type SurfaceVariants = {
|
|
6
|
+
variant?: SurfaceVariant;
|
|
7
|
+
};
|
|
8
|
+
export type SurfaceProps = Omit<JSX.HTMLAttributes<HTMLDivElement>, "children"> & IComponentBaseProps & SurfaceVariants & {
|
|
9
|
+
children?: JSX.Element;
|
|
10
|
+
};
|
|
11
|
+
export declare function Surface(props: SurfaceProps): JSX.Element;
|
|
12
|
+
export default Surface;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import * as __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__ from "solid-js/web";
|
|
2
|
+
import "./Surface.css";
|
|
3
|
+
import * as __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__ from "solid-js";
|
|
4
|
+
import * as __WEBPACK_EXTERNAL_MODULE_tailwind_merge_e05e3e95__ from "tailwind-merge";
|
|
5
|
+
var _tmpl$ = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<div>");
|
|
6
|
+
const SURFACE_VARIANT_CLASS = {
|
|
7
|
+
default: "surface--default",
|
|
8
|
+
secondary: "surface--secondary",
|
|
9
|
+
tertiary: "surface--tertiary",
|
|
10
|
+
transparent: "surface--transparent"
|
|
11
|
+
};
|
|
12
|
+
function Surface(props) {
|
|
13
|
+
const [local, others] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.splitProps)(props, [
|
|
14
|
+
"children",
|
|
15
|
+
"class",
|
|
16
|
+
"className",
|
|
17
|
+
"dataTheme",
|
|
18
|
+
"style",
|
|
19
|
+
"variant"
|
|
20
|
+
]);
|
|
21
|
+
const variant = ()=>local.variant ?? "default";
|
|
22
|
+
return (()=>{
|
|
23
|
+
var _el$ = _tmpl$();
|
|
24
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.spread)(_el$, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.mergeProps)(others, {
|
|
25
|
+
get ["class"] () {
|
|
26
|
+
return (0, __WEBPACK_EXTERNAL_MODULE_tailwind_merge_e05e3e95__.twMerge)("surface", SURFACE_VARIANT_CLASS[variant()], local.class, local.className);
|
|
27
|
+
},
|
|
28
|
+
"data-slot": "surface",
|
|
29
|
+
get ["data-theme"] () {
|
|
30
|
+
return local.dataTheme;
|
|
31
|
+
},
|
|
32
|
+
get style () {
|
|
33
|
+
return local.style;
|
|
34
|
+
}
|
|
35
|
+
}), false, true);
|
|
36
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$, ()=>local.children);
|
|
37
|
+
return _el$;
|
|
38
|
+
})();
|
|
39
|
+
}
|
|
40
|
+
const surface_Surface = Surface;
|
|
41
|
+
export { Surface, surface_Surface as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default, Surface, type SurfaceProps, type SurfaceVariant, type SurfaceVariants } from "./Surface";
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import * as __WEBPACK_EXTERNAL_MODULE__Surface_js_0cf8f490__ from "./Surface.js";
|
|
2
|
+
var __webpack_exports__Surface = __WEBPACK_EXTERNAL_MODULE__Surface_js_0cf8f490__.Surface;
|
|
3
|
+
var __webpack_exports__default = __WEBPACK_EXTERNAL_MODULE__Surface_js_0cf8f490__["default"];
|
|
4
|
+
export { __webpack_exports__Surface as Surface, __webpack_exports__default as default };
|
|
@@ -1,9 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
export { useTablePagination, type UseTablePaginationOptions, type UseTablePaginationResult, } from "./useTablePagination";
|
|
3
|
-
export { useTableFiltering, type UseTableFilteringOptions, type UseTableFilteringResult, } from "./useTableFiltering";
|
|
4
|
-
export { useTableSelection, type UseTableSelectionOptions, type UseTableSelectionResult, type TableSelectionState, } from "./useTableSelection";
|
|
5
|
-
export { useTableExpansion, type UseTableExpansionOptions, type UseTableExpansionResult, } from "./useTableExpansion";
|
|
6
|
-
export { useTableModel, type UseTableModelOptions, } from "./useTableModel";
|
|
7
|
-
export { toSortDescriptor, toSortingState } from "./helpers";
|
|
8
|
-
export { useAnchoredOverlayPosition } from "./useAnchoredOverlayPosition";
|
|
9
|
-
export type { UseAnchoredOverlayPositionOptions } from "./useAnchoredOverlayPosition";
|
|
1
|
+
export * from "../../../hooks/table";
|
|
@@ -1,18 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import * as __WEBPACK_EXTERNAL_MODULE__useTablePagination_js_221a602e__ from "./useTablePagination.js";
|
|
3
|
-
import * as __WEBPACK_EXTERNAL_MODULE__useTableFiltering_js_c008d8f8__ from "./useTableFiltering.js";
|
|
4
|
-
import * as __WEBPACK_EXTERNAL_MODULE__useTableSelection_js_6791c7a2__ from "./useTableSelection.js";
|
|
5
|
-
import * as __WEBPACK_EXTERNAL_MODULE__useTableExpansion_js_e1dc5a4d__ from "./useTableExpansion.js";
|
|
6
|
-
import * as __WEBPACK_EXTERNAL_MODULE__useTableModel_js_1f373411__ from "./useTableModel.js";
|
|
7
|
-
import * as __WEBPACK_EXTERNAL_MODULE__helpers_js_87289b43__ from "./helpers.js";
|
|
8
|
-
import * as __WEBPACK_EXTERNAL_MODULE__useAnchoredOverlayPosition_js_ef09d6e3__ from "./useAnchoredOverlayPosition.js";
|
|
9
|
-
var __webpack_exports__toSortDescriptor = __WEBPACK_EXTERNAL_MODULE__helpers_js_87289b43__.toSortDescriptor;
|
|
10
|
-
var __webpack_exports__toSortingState = __WEBPACK_EXTERNAL_MODULE__helpers_js_87289b43__.toSortingState;
|
|
11
|
-
var __webpack_exports__useAnchoredOverlayPosition = __WEBPACK_EXTERNAL_MODULE__useAnchoredOverlayPosition_js_ef09d6e3__.useAnchoredOverlayPosition;
|
|
12
|
-
var __webpack_exports__useTableExpansion = __WEBPACK_EXTERNAL_MODULE__useTableExpansion_js_e1dc5a4d__.useTableExpansion;
|
|
13
|
-
var __webpack_exports__useTableFiltering = __WEBPACK_EXTERNAL_MODULE__useTableFiltering_js_c008d8f8__.useTableFiltering;
|
|
14
|
-
var __webpack_exports__useTableModel = __WEBPACK_EXTERNAL_MODULE__useTableModel_js_1f373411__.useTableModel;
|
|
15
|
-
var __webpack_exports__useTablePagination = __WEBPACK_EXTERNAL_MODULE__useTablePagination_js_221a602e__.useTablePagination;
|
|
16
|
-
var __webpack_exports__useTableSelection = __WEBPACK_EXTERNAL_MODULE__useTableSelection_js_6791c7a2__.useTableSelection;
|
|
17
|
-
var __webpack_exports__useTableSorting = __WEBPACK_EXTERNAL_MODULE__useTableSorting_js_bcbcf7e7__.useTableSorting;
|
|
18
|
-
export { __webpack_exports__toSortDescriptor as toSortDescriptor, __webpack_exports__toSortingState as toSortingState, __webpack_exports__useAnchoredOverlayPosition as useAnchoredOverlayPosition, __webpack_exports__useTableExpansion as useTableExpansion, __webpack_exports__useTableFiltering as useTableFiltering, __webpack_exports__useTableModel as useTableModel, __webpack_exports__useTablePagination as useTablePagination, __webpack_exports__useTableSelection as useTableSelection, __webpack_exports__useTableSorting as useTableSorting };
|
|
1
|
+
export * from "../../../hooks/table/index.js";
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
@layer components {
|
|
2
|
+
.tag {
|
|
3
|
+
--tag-optical-offset: 0.031em;
|
|
4
|
+
|
|
5
|
+
position: relative;
|
|
6
|
+
display: inline-flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
gap: 0.25rem;
|
|
9
|
+
border-radius: 9999px;
|
|
10
|
+
font-weight: 500;
|
|
11
|
+
user-select: none;
|
|
12
|
+
-webkit-tap-highlight-color: transparent;
|
|
13
|
+
transform-origin: center;
|
|
14
|
+
cursor: pointer;
|
|
15
|
+
transition:
|
|
16
|
+
color 100ms ease,
|
|
17
|
+
transform 100ms ease,
|
|
18
|
+
opacity 100ms ease,
|
|
19
|
+
background-color 100ms ease,
|
|
20
|
+
box-shadow 100ms ease;
|
|
21
|
+
|
|
22
|
+
--tag-bg-default: var(--color-default);
|
|
23
|
+
--tag-fg-default: var(--color-default-foreground);
|
|
24
|
+
--tag-bg-default-hover: var(--color-default-hover);
|
|
25
|
+
--tag-bg-surface: var(--color-surface, var(--color-base-200));
|
|
26
|
+
--tag-fg-surface: var(--color-surface-foreground, var(--color-base-content));
|
|
27
|
+
--tag-bg-surface-hover: var(--color-surface-hover, var(--color-base-300));
|
|
28
|
+
--tag-bg-selected: var(--color-accent-soft);
|
|
29
|
+
--tag-fg-selected: var(--color-accent-soft-foreground);
|
|
30
|
+
--tag-bg-selected-hover: var(--color-accent-soft-hover);
|
|
31
|
+
--tag-bg: var(--tag-bg-default);
|
|
32
|
+
--tag-fg: var(--tag-fg-default);
|
|
33
|
+
--tag-bg-hover: var(--tag-bg-default-hover);
|
|
34
|
+
|
|
35
|
+
background-color: var(--tag-bg);
|
|
36
|
+
color: var(--tag-fg);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.tag__icon {
|
|
40
|
+
display: inline-flex;
|
|
41
|
+
align-items: center;
|
|
42
|
+
justify-content: center;
|
|
43
|
+
flex-shrink: 0;
|
|
44
|
+
pointer-events: none;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.tag__icon > * {
|
|
48
|
+
width: 0.75rem;
|
|
49
|
+
height: 0.75rem;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.tag:is([data-disabled="true"], [aria-disabled="true"]) {
|
|
53
|
+
opacity: 0.5;
|
|
54
|
+
cursor: not-allowed;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.tag:is(:focus-visible, [data-focus-visible]) {
|
|
58
|
+
outline: 2px solid var(--color-accent);
|
|
59
|
+
outline-offset: 2px;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.tag:is([data-selected="true"], [aria-selected="true"]) {
|
|
63
|
+
background-color: var(--tag-bg-selected);
|
|
64
|
+
color: var(--tag-fg-selected);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
@media (hover: hover) {
|
|
68
|
+
.tag:is(:hover, [data-hovered="true"]):not([data-selected="true"]):not([data-disabled="true"]) {
|
|
69
|
+
background-color: var(--tag-bg-hover);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.tag:is([data-selected="true"], [aria-selected="true"]):is(:hover, [data-hovered="true"]) {
|
|
73
|
+
background-color: var(--tag-bg-selected-hover);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.tag--sm {
|
|
78
|
+
padding-inline: 0.5rem;
|
|
79
|
+
padding-block: 0.125rem;
|
|
80
|
+
font-size: 0.75rem;
|
|
81
|
+
line-height: 1rem;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.tag--md {
|
|
85
|
+
padding-inline: 0.5rem;
|
|
86
|
+
padding-block: 0.25rem;
|
|
87
|
+
font-size: 0.75rem;
|
|
88
|
+
line-height: 1rem;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.tag--lg {
|
|
92
|
+
padding-inline: 0.625rem;
|
|
93
|
+
padding-block: 0.375rem;
|
|
94
|
+
font-size: 0.875rem;
|
|
95
|
+
line-height: 1.25rem;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.tag--default {
|
|
99
|
+
--tag-bg: var(--tag-bg-default);
|
|
100
|
+
--tag-fg: var(--tag-fg-default);
|
|
101
|
+
--tag-bg-hover: var(--tag-bg-default-hover);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.tag--surface {
|
|
105
|
+
--tag-bg: var(--tag-bg-surface);
|
|
106
|
+
--tag-fg: var(--tag-fg-surface);
|
|
107
|
+
--tag-bg-hover: var(--tag-bg-surface-hover);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.tag__remove-button {
|
|
111
|
+
width: 0.75rem;
|
|
112
|
+
height: 0.75rem;
|
|
113
|
+
color: inherit;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.tag__remove-button > * {
|
|
117
|
+
width: inherit;
|
|
118
|
+
height: inherit;
|
|
119
|
+
pointer-events: none;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import "./Tag.css";
|
|
2
|
+
import { type Component, type JSX, type ParentComponent } from "solid-js";
|
|
3
|
+
import { type CloseButtonProps } from "../close-button";
|
|
4
|
+
import type { IComponentBaseProps } from "../types";
|
|
5
|
+
export type TagSize = "sm" | "md" | "lg";
|
|
6
|
+
export type TagVariant = "default" | "surface";
|
|
7
|
+
type TagRenderProps = {
|
|
8
|
+
isSelected: boolean;
|
|
9
|
+
isDisabled: boolean;
|
|
10
|
+
allowsRemoving: boolean;
|
|
11
|
+
};
|
|
12
|
+
export type TagRootProps = Omit<JSX.HTMLAttributes<HTMLDivElement>, "children"> & IComponentBaseProps & {
|
|
13
|
+
id?: string | number;
|
|
14
|
+
textValue?: string;
|
|
15
|
+
isDisabled?: boolean;
|
|
16
|
+
size?: TagSize;
|
|
17
|
+
variant?: TagVariant;
|
|
18
|
+
startIcon?: JSX.Element;
|
|
19
|
+
endIcon?: JSX.Element;
|
|
20
|
+
children?: JSX.Element | ((props: TagRenderProps) => JSX.Element);
|
|
21
|
+
};
|
|
22
|
+
export type TagRemoveButtonProps = Omit<CloseButtonProps, "isDisabled"> & IComponentBaseProps & {
|
|
23
|
+
isDisabled?: boolean;
|
|
24
|
+
};
|
|
25
|
+
declare const TagRoot: ParentComponent<TagRootProps>;
|
|
26
|
+
declare const TagRemoveButton: Component<TagRemoveButtonProps>;
|
|
27
|
+
declare const Tag: ParentComponent<TagRootProps> & {
|
|
28
|
+
Root: ParentComponent<TagRootProps>;
|
|
29
|
+
RemoveButton: Component<TagRemoveButtonProps>;
|
|
30
|
+
};
|
|
31
|
+
export default Tag;
|
|
32
|
+
export { Tag, TagRoot, TagRemoveButton };
|
|
33
|
+
export type { TagRootProps as TagProps, TagRenderProps };
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
import * as __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__ from "solid-js/web";
|
|
2
|
+
import "./Tag.css";
|
|
3
|
+
import * as __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__ from "solid-js";
|
|
4
|
+
import * as __WEBPACK_EXTERNAL_MODULE_tailwind_merge_e05e3e95__ from "tailwind-merge";
|
|
5
|
+
import * as __WEBPACK_EXTERNAL_MODULE__close_button_index_js_620c3b77__ from "../close-button/index.js";
|
|
6
|
+
import * as __WEBPACK_EXTERNAL_MODULE__tag_group_context_js_fcbb3264__ from "../tag-group/context.js";
|
|
7
|
+
var _tmpl$ = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<div>"), _tmpl$2 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)('<span class="tag__icon tag__icon--start"data-slot=tag-start-icon>'), _tmpl$3 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)('<span class="tag__icon tag__icon--end"data-slot=tag-end-icon>');
|
|
8
|
+
const invokeEventHandler = (handler, event)=>{
|
|
9
|
+
if ("function" == typeof handler) return void handler(event);
|
|
10
|
+
if (Array.isArray(handler) && "function" == typeof handler[0]) handler[0](handler[1], event);
|
|
11
|
+
};
|
|
12
|
+
const toSlug = (value)=>value.trim().toLowerCase().replace(/[^\w\s-]/g, "").replace(/\s+/g, "-");
|
|
13
|
+
const extractTextValue = (nodes)=>{
|
|
14
|
+
for (const node of nodes){
|
|
15
|
+
if ("string" == typeof node && node.trim().length > 0) return node.trim();
|
|
16
|
+
if ("number" == typeof node) return String(node);
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
const TAG_SIZE_CLASS_MAP = {
|
|
20
|
+
sm: "tag--sm",
|
|
21
|
+
md: "tag--md",
|
|
22
|
+
lg: "tag--lg"
|
|
23
|
+
};
|
|
24
|
+
const TAG_VARIANT_CLASS_MAP = {
|
|
25
|
+
default: "tag--default",
|
|
26
|
+
surface: "tag--surface"
|
|
27
|
+
};
|
|
28
|
+
const TagContext = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createContext)();
|
|
29
|
+
const TagRoot = (props)=>{
|
|
30
|
+
const fallbackKey = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createUniqueId)();
|
|
31
|
+
const group = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.useContext)(__WEBPACK_EXTERNAL_MODULE__tag_group_context_js_fcbb3264__.TagGroupContext);
|
|
32
|
+
const [local, others] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.splitProps)(props, [
|
|
33
|
+
"children",
|
|
34
|
+
"class",
|
|
35
|
+
"className",
|
|
36
|
+
"dataTheme",
|
|
37
|
+
"style",
|
|
38
|
+
"id",
|
|
39
|
+
"textValue",
|
|
40
|
+
"isDisabled",
|
|
41
|
+
"size",
|
|
42
|
+
"variant",
|
|
43
|
+
"startIcon",
|
|
44
|
+
"endIcon",
|
|
45
|
+
"onClick",
|
|
46
|
+
"onKeyDown",
|
|
47
|
+
"role",
|
|
48
|
+
"tabIndex"
|
|
49
|
+
]);
|
|
50
|
+
const resolvedChildren = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.children)(()=>local.children);
|
|
51
|
+
const isRenderFnChild = ()=>"function" == typeof local.children;
|
|
52
|
+
const derivedText = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createMemo)(()=>isRenderFnChild() ? void 0 : extractTextValue(resolvedChildren.toArray()));
|
|
53
|
+
const tagKey = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createMemo)(()=>{
|
|
54
|
+
if (null != local.id) return String(local.id);
|
|
55
|
+
if (local.textValue) return toSlug(local.textValue);
|
|
56
|
+
if (derivedText()) return toSlug(derivedText());
|
|
57
|
+
return fallbackKey;
|
|
58
|
+
});
|
|
59
|
+
const size = ()=>local.size ?? group?.size() ?? "md";
|
|
60
|
+
const variant = ()=>local.variant ?? group?.variant() ?? "default";
|
|
61
|
+
const isSelectable = ()=>Boolean(group && "none" !== group.selectionMode());
|
|
62
|
+
const isSelected = ()=>Boolean(group?.selectedKeys().has(tagKey()));
|
|
63
|
+
const isDisabled = ()=>Boolean(local.isDisabled) || Boolean(group?.isDisabled()) || Boolean(group?.disabledKeys().has(tagKey()));
|
|
64
|
+
const allowsRemoving = ()=>Boolean(group?.allowsRemoving()) && Boolean(tagKey());
|
|
65
|
+
const renderState = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createMemo)(()=>({
|
|
66
|
+
isSelected: isSelected(),
|
|
67
|
+
isDisabled: isDisabled(),
|
|
68
|
+
allowsRemoving: allowsRemoving()
|
|
69
|
+
}));
|
|
70
|
+
const handleSelect = (event)=>{
|
|
71
|
+
if (!group || !isSelectable() || isDisabled()) return;
|
|
72
|
+
group.selectKey(tagKey(), event);
|
|
73
|
+
};
|
|
74
|
+
const handleClick = (event)=>{
|
|
75
|
+
invokeEventHandler(local.onClick, event);
|
|
76
|
+
if (event.defaultPrevented) return;
|
|
77
|
+
handleSelect(event);
|
|
78
|
+
};
|
|
79
|
+
const handleKeyDown = (event)=>{
|
|
80
|
+
invokeEventHandler(local.onKeyDown, event);
|
|
81
|
+
if (event.defaultPrevented) return;
|
|
82
|
+
if (event.target !== event.currentTarget) return;
|
|
83
|
+
if (!isSelectable() || isDisabled()) return;
|
|
84
|
+
if ("Enter" !== event.key && " " !== event.key) return;
|
|
85
|
+
event.preventDefault();
|
|
86
|
+
handleSelect(event);
|
|
87
|
+
};
|
|
88
|
+
const remove = (event)=>{
|
|
89
|
+
if (!group || !allowsRemoving() || isDisabled()) return;
|
|
90
|
+
event.preventDefault();
|
|
91
|
+
event.stopPropagation();
|
|
92
|
+
group.removeKey(tagKey(), event);
|
|
93
|
+
};
|
|
94
|
+
return (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(TagContext.Provider, {
|
|
95
|
+
value: {
|
|
96
|
+
allowsRemoving,
|
|
97
|
+
isDisabled,
|
|
98
|
+
removeIcon: ()=>local.endIcon,
|
|
99
|
+
remove
|
|
100
|
+
},
|
|
101
|
+
get children () {
|
|
102
|
+
var _el$ = _tmpl$();
|
|
103
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.spread)(_el$, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.mergeProps)(others, {
|
|
104
|
+
get ["class"] () {
|
|
105
|
+
return (0, __WEBPACK_EXTERNAL_MODULE_tailwind_merge_e05e3e95__.twMerge)("tag", TAG_SIZE_CLASS_MAP[size()], TAG_VARIANT_CLASS_MAP[variant()], local.class, local.className);
|
|
106
|
+
},
|
|
107
|
+
"data-slot": "tag",
|
|
108
|
+
get ["data-theme"] () {
|
|
109
|
+
return local.dataTheme;
|
|
110
|
+
},
|
|
111
|
+
get ["data-size"] () {
|
|
112
|
+
return size();
|
|
113
|
+
},
|
|
114
|
+
get ["data-variant"] () {
|
|
115
|
+
return variant();
|
|
116
|
+
},
|
|
117
|
+
get ["data-selected"] () {
|
|
118
|
+
return isSelected() ? "true" : "false";
|
|
119
|
+
},
|
|
120
|
+
get ["data-disabled"] () {
|
|
121
|
+
return isDisabled() ? "true" : "false";
|
|
122
|
+
},
|
|
123
|
+
get ["data-key"] () {
|
|
124
|
+
return tagKey();
|
|
125
|
+
},
|
|
126
|
+
get ["aria-selected"] () {
|
|
127
|
+
return (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.memo)(()=>!!isSelectable())() ? isSelected() ? "true" : "false" : void 0;
|
|
128
|
+
},
|
|
129
|
+
get ["aria-disabled"] () {
|
|
130
|
+
return isDisabled() ? "true" : "false";
|
|
131
|
+
},
|
|
132
|
+
get role () {
|
|
133
|
+
return local.role ?? (isSelectable() ? "option" : void 0);
|
|
134
|
+
},
|
|
135
|
+
get tabIndex () {
|
|
136
|
+
return local.tabIndex ?? (isSelectable() && !isDisabled() ? 0 : void 0);
|
|
137
|
+
},
|
|
138
|
+
get style () {
|
|
139
|
+
return local.style;
|
|
140
|
+
},
|
|
141
|
+
onClick: handleClick,
|
|
142
|
+
onKeyDown: handleKeyDown
|
|
143
|
+
}), false, true);
|
|
144
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.Show, {
|
|
145
|
+
get when () {
|
|
146
|
+
return isRenderFnChild();
|
|
147
|
+
},
|
|
148
|
+
get fallback () {
|
|
149
|
+
return [
|
|
150
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.Show, {
|
|
151
|
+
get when () {
|
|
152
|
+
return local.startIcon;
|
|
153
|
+
},
|
|
154
|
+
get children () {
|
|
155
|
+
var _el$2 = _tmpl$2();
|
|
156
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$2, ()=>local.startIcon);
|
|
157
|
+
return _el$2;
|
|
158
|
+
}
|
|
159
|
+
}),
|
|
160
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.memo)(resolvedChildren),
|
|
161
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.Show, {
|
|
162
|
+
get when () {
|
|
163
|
+
return allowsRemoving() && local.endIcon;
|
|
164
|
+
},
|
|
165
|
+
get children () {
|
|
166
|
+
return (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(TagRemoveButton, {
|
|
167
|
+
get children () {
|
|
168
|
+
return local.endIcon;
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
}),
|
|
173
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.Show, {
|
|
174
|
+
get when () {
|
|
175
|
+
return !allowsRemoving() && local.endIcon;
|
|
176
|
+
},
|
|
177
|
+
get children () {
|
|
178
|
+
var _el$3 = _tmpl$3();
|
|
179
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$3, ()=>local.endIcon);
|
|
180
|
+
return _el$3;
|
|
181
|
+
}
|
|
182
|
+
})
|
|
183
|
+
];
|
|
184
|
+
},
|
|
185
|
+
get children () {
|
|
186
|
+
return local.children(renderState());
|
|
187
|
+
}
|
|
188
|
+
}));
|
|
189
|
+
return _el$;
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
};
|
|
193
|
+
const TagRemoveButton = (props)=>{
|
|
194
|
+
const context = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.useContext)(TagContext);
|
|
195
|
+
const hasIcon = ()=>null != props.children || null != props.startIcon || null != props.endIcon || context?.removeIcon() != null;
|
|
196
|
+
const [local, others] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.splitProps)(props, [
|
|
197
|
+
"children",
|
|
198
|
+
"class",
|
|
199
|
+
"className",
|
|
200
|
+
"dataTheme",
|
|
201
|
+
"style",
|
|
202
|
+
"onClick",
|
|
203
|
+
"isDisabled",
|
|
204
|
+
"aria-label"
|
|
205
|
+
]);
|
|
206
|
+
const handleClick = (event)=>{
|
|
207
|
+
invokeEventHandler(local.onClick, event);
|
|
208
|
+
if (event.defaultPrevented) return;
|
|
209
|
+
context?.remove(event);
|
|
210
|
+
};
|
|
211
|
+
if (!context?.allowsRemoving()) return null;
|
|
212
|
+
if (!hasIcon()) return null;
|
|
213
|
+
return (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE__close_button_index_js_620c3b77__["default"], (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.mergeProps)(others, {
|
|
214
|
+
get ["aria-label"] () {
|
|
215
|
+
return local["aria-label"] ?? "Remove tag";
|
|
216
|
+
},
|
|
217
|
+
get ["class"] () {
|
|
218
|
+
return (0, __WEBPACK_EXTERNAL_MODULE_tailwind_merge_e05e3e95__.twMerge)("tag__remove-button", local.class, local.className);
|
|
219
|
+
},
|
|
220
|
+
"data-slot": "tag-remove-button",
|
|
221
|
+
get ["data-theme"] () {
|
|
222
|
+
return local.dataTheme;
|
|
223
|
+
},
|
|
224
|
+
get style () {
|
|
225
|
+
return local.style;
|
|
226
|
+
},
|
|
227
|
+
get isDisabled () {
|
|
228
|
+
return local.isDisabled ?? context.isDisabled();
|
|
229
|
+
},
|
|
230
|
+
onClick: handleClick,
|
|
231
|
+
get children () {
|
|
232
|
+
return local.children ?? context.removeIcon();
|
|
233
|
+
}
|
|
234
|
+
}));
|
|
235
|
+
};
|
|
236
|
+
const Tag_Tag = Object.assign(TagRoot, {
|
|
237
|
+
Root: TagRoot,
|
|
238
|
+
RemoveButton: TagRemoveButton
|
|
239
|
+
});
|
|
240
|
+
const Tag = Tag_Tag;
|
|
241
|
+
export { Tag_Tag as Tag, TagRemoveButton, TagRoot, Tag as default };
|