@xanui/ui 1.2.6 → 1.2.7
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/Accordion/index.cjs +5 -5
- package/Accordion/index.cjs.map +1 -1
- package/Accordion/index.d.ts +3 -3
- package/Accordion/index.js +5 -5
- package/Accordion/index.js.map +1 -1
- package/Alert/index.cjs +19 -17
- package/Alert/index.cjs.map +1 -1
- package/Alert/index.d.ts +2 -2
- package/Alert/index.js +19 -17
- package/Alert/index.js.map +1 -1
- package/Autocomplete/index.cjs +2 -2
- package/Autocomplete/index.cjs.map +1 -1
- package/Autocomplete/index.d.ts +7 -7
- package/Autocomplete/index.js +2 -2
- package/Autocomplete/index.js.map +1 -1
- package/Avatar/index.cjs +2 -2
- package/Avatar/index.cjs.map +1 -1
- package/Avatar/index.d.ts +2 -2
- package/Avatar/index.js +2 -2
- package/Avatar/index.js.map +1 -1
- package/AvatarBox/index.cjs +19 -0
- package/AvatarBox/index.cjs.map +1 -0
- package/AvatarBox/index.d.ts +19 -0
- package/AvatarBox/index.js +17 -0
- package/AvatarBox/index.js.map +1 -0
- package/AvatarPicker/index.cjs +80 -0
- package/AvatarPicker/index.cjs.map +1 -0
- package/AvatarPicker/index.d.ts +27 -0
- package/AvatarPicker/index.js +78 -0
- package/AvatarPicker/index.js.map +1 -0
- package/Badge/index.cjs +1 -1
- package/Badge/index.cjs.map +1 -1
- package/Badge/index.d.ts +4 -4
- package/Badge/index.js +1 -1
- package/Badge/index.js.map +1 -1
- package/Box/index.d.ts +2 -2
- package/Button/index.cjs +5 -3
- package/Button/index.cjs.map +1 -1
- package/Button/index.d.ts +2 -2
- package/Button/index.js +5 -3
- package/Button/index.js.map +1 -1
- package/ButtonGroup/index.cjs +3 -2
- package/ButtonGroup/index.cjs.map +1 -1
- package/ButtonGroup/index.d.ts +2 -2
- package/ButtonGroup/index.js +3 -2
- package/ButtonGroup/index.js.map +1 -1
- package/Calendar/index.cjs +10 -10
- package/Calendar/index.cjs.map +1 -1
- package/Calendar/index.js +10 -10
- package/Calendar/index.js.map +1 -1
- package/CalendarInput/index.cjs +1 -1
- package/CalendarInput/index.cjs.map +1 -1
- package/CalendarInput/index.js +1 -1
- package/CalendarInput/index.js.map +1 -1
- package/Carousel/index.cjs +231 -0
- package/Carousel/index.cjs.map +1 -0
- package/Carousel/index.d.ts +28 -0
- package/Carousel/index.js +229 -0
- package/Carousel/index.js.map +1 -0
- package/Checkbox/index.cjs +2 -2
- package/Checkbox/index.cjs.map +1 -1
- package/Checkbox/index.d.ts +2 -2
- package/Checkbox/index.js +2 -2
- package/Checkbox/index.js.map +1 -1
- package/Chip/index.cjs +3 -3
- package/Chip/index.cjs.map +1 -1
- package/Chip/index.d.ts +2 -2
- package/Chip/index.js +3 -3
- package/Chip/index.js.map +1 -1
- package/CircleProgress/index.cjs +10 -10
- package/CircleProgress/index.cjs.map +1 -1
- package/CircleProgress/index.d.ts +2 -2
- package/CircleProgress/index.js +10 -10
- package/CircleProgress/index.js.map +1 -1
- package/ClickOutside/index.cjs +3 -12
- package/ClickOutside/index.cjs.map +1 -1
- package/ClickOutside/index.d.ts +3 -3
- package/ClickOutside/index.js +4 -13
- package/ClickOutside/index.js.map +1 -1
- package/Collaps/index.cjs +5 -5
- package/Collaps/index.cjs.map +1 -1
- package/Collaps/index.d.ts +2 -2
- package/Collaps/index.js +5 -5
- package/Collaps/index.js.map +1 -1
- package/Container/index.d.ts +2 -2
- package/DataFilter/index.d.ts +2 -2
- package/DataFilter/options/DateFilter.cjs +3 -3
- package/DataFilter/options/DateFilter.cjs.map +1 -1
- package/DataFilter/options/DateFilter.js +3 -3
- package/DataFilter/options/DateFilter.js.map +1 -1
- package/DataFilter/options/DateRangeFilter.cjs +2 -2
- package/DataFilter/options/DateRangeFilter.cjs.map +1 -1
- package/DataFilter/options/DateRangeFilter.js +2 -2
- package/DataFilter/options/DateRangeFilter.js.map +1 -1
- package/DataFilter/options/MultiSelectFilter.cjs +3 -3
- package/DataFilter/options/MultiSelectFilter.cjs.map +1 -1
- package/DataFilter/options/MultiSelectFilter.js +3 -3
- package/DataFilter/options/MultiSelectFilter.js.map +1 -1
- package/DataFilter/options/NumberFilter.cjs +2 -2
- package/DataFilter/options/NumberFilter.cjs.map +1 -1
- package/DataFilter/options/NumberFilter.js +2 -2
- package/DataFilter/options/NumberFilter.js.map +1 -1
- package/DataFilter/options/NumberRangeFilter.cjs +2 -2
- package/DataFilter/options/NumberRangeFilter.cjs.map +1 -1
- package/DataFilter/options/NumberRangeFilter.js +2 -2
- package/DataFilter/options/NumberRangeFilter.js.map +1 -1
- package/DataFilter/options/SelectFilter.cjs +3 -3
- package/DataFilter/options/SelectFilter.cjs.map +1 -1
- package/DataFilter/options/SelectFilter.js +3 -3
- package/DataFilter/options/SelectFilter.js.map +1 -1
- package/DataFilter/options/TextFilter.cjs +2 -2
- package/DataFilter/options/TextFilter.cjs.map +1 -1
- package/DataFilter/options/TextFilter.js +2 -2
- package/DataFilter/options/TextFilter.js.map +1 -1
- package/Datatable/FilterBox.cjs +2 -2
- package/Datatable/FilterBox.cjs.map +1 -1
- package/Datatable/FilterBox.js +2 -2
- package/Datatable/FilterBox.js.map +1 -1
- package/Datatable/Row.cjs +2 -2
- package/Datatable/Row.cjs.map +1 -1
- package/Datatable/Row.js +2 -2
- package/Datatable/Row.js.map +1 -1
- package/Datatable/SelectedBox.cjs +2 -2
- package/Datatable/SelectedBox.cjs.map +1 -1
- package/Datatable/SelectedBox.js +2 -2
- package/Datatable/SelectedBox.js.map +1 -1
- package/Datatable/Table.cjs +1 -1
- package/Datatable/Table.cjs.map +1 -1
- package/Datatable/Table.js +1 -1
- package/Datatable/Table.js.map +1 -1
- package/Datatable/TableHead.cjs +3 -3
- package/Datatable/TableHead.cjs.map +1 -1
- package/Datatable/TableHead.js +3 -3
- package/Datatable/TableHead.js.map +1 -1
- package/Datatable/index.cjs +1 -1
- package/Datatable/index.cjs.map +1 -1
- package/Datatable/index.d.ts +2 -2
- package/Datatable/index.js +1 -1
- package/Datatable/index.js.map +1 -1
- package/Divider/index.cjs +3 -3
- package/Divider/index.cjs.map +1 -1
- package/Divider/index.d.ts +2 -2
- package/Divider/index.js +3 -3
- package/Divider/index.js.map +1 -1
- package/Drawer/index.cjs +2 -2
- package/Drawer/index.cjs.map +1 -1
- package/Drawer/index.js +2 -2
- package/Drawer/index.js.map +1 -1
- package/FilePicker/index.cjs +115 -0
- package/FilePicker/index.cjs.map +1 -0
- package/FilePicker/index.d.ts +23 -0
- package/FilePicker/index.js +113 -0
- package/FilePicker/index.js.map +1 -0
- package/Form/index.cjs +1 -1
- package/Form/index.cjs.map +1 -1
- package/Form/index.d.ts +2 -2
- package/Form/index.js +1 -1
- package/Form/index.js.map +1 -1
- package/GalleryPicker/index.cjs +88 -0
- package/GalleryPicker/index.cjs.map +1 -0
- package/GalleryPicker/index.d.ts +26 -0
- package/GalleryPicker/index.js +86 -0
- package/GalleryPicker/index.js.map +1 -0
- package/GridContainer/index.d.ts +2 -2
- package/GridItem/index.d.ts +2 -2
- package/IconButton/index.cjs +6 -3
- package/IconButton/index.cjs.map +1 -1
- package/IconButton/index.d.ts +2 -2
- package/IconButton/index.js +6 -3
- package/IconButton/index.js.map +1 -1
- package/Image/index.cjs +2 -14
- package/Image/index.cjs.map +1 -1
- package/Image/index.d.ts +3 -5
- package/Image/index.js +3 -15
- package/Image/index.js.map +1 -1
- package/Input/index.cjs +10 -10
- package/Input/index.cjs.map +1 -1
- package/Input/index.d.ts +14 -14
- package/Input/index.js +10 -10
- package/Input/index.js.map +1 -1
- package/InputNumber/index.d.ts +2 -2
- package/Label/index.cjs +1 -1
- package/Label/index.cjs.map +1 -1
- package/Label/index.d.ts +2 -2
- package/Label/index.js +1 -1
- package/Label/index.js.map +1 -1
- package/Layer/index.cjs +12 -13
- package/Layer/index.cjs.map +1 -1
- package/Layer/index.d.ts +5 -5
- package/Layer/index.js +13 -14
- package/Layer/index.js.map +1 -1
- package/LineProgress/index.cjs +6 -6
- package/LineProgress/index.cjs.map +1 -1
- package/LineProgress/index.d.ts +2 -2
- package/LineProgress/index.js +6 -6
- package/LineProgress/index.js.map +1 -1
- package/Link/index.cjs +41 -0
- package/Link/index.cjs.map +1 -0
- package/Link/index.d.ts +17 -0
- package/Link/index.js +39 -0
- package/Link/index.js.map +1 -0
- package/List/index.cjs +1 -1
- package/List/index.cjs.map +1 -1
- package/List/index.d.ts +2 -2
- package/List/index.js +1 -1
- package/List/index.js.map +1 -1
- package/ListItem/index.cjs +8 -8
- package/ListItem/index.cjs.map +1 -1
- package/ListItem/index.d.ts +2 -2
- package/ListItem/index.js +8 -8
- package/ListItem/index.js.map +1 -1
- package/LoadingBox/index.cjs +2 -2
- package/LoadingBox/index.cjs.map +1 -1
- package/LoadingBox/index.d.ts +2 -2
- package/LoadingBox/index.js +2 -2
- package/LoadingBox/index.js.map +1 -1
- package/Menu/index.cjs +6 -21
- package/Menu/index.cjs.map +1 -1
- package/Menu/index.d.ts +6 -4
- package/Menu/index.js +6 -21
- package/Menu/index.js.map +1 -1
- package/Modal/index.cjs +5 -5
- package/Modal/index.cjs.map +1 -1
- package/Modal/index.js +5 -5
- package/Modal/index.js.map +1 -1
- package/Option/index.d.ts +2 -2
- package/PasswordInput/index.cjs +21 -0
- package/PasswordInput/index.cjs.map +1 -0
- package/PasswordInput/index.d.ts +11 -0
- package/PasswordInput/index.js +19 -0
- package/PasswordInput/index.js.map +1 -0
- package/Portal/index.d.ts +3 -3
- package/Radio/index.d.ts +2 -2
- package/RangeSlider/index.cjs +158 -0
- package/RangeSlider/index.cjs.map +1 -0
- package/RangeSlider/index.d.ts +24 -0
- package/RangeSlider/index.js +156 -0
- package/RangeSlider/index.js.map +1 -0
- package/Scrollbar/index.cjs +6 -6
- package/Scrollbar/index.cjs.map +1 -1
- package/Scrollbar/index.d.ts +3 -3
- package/Scrollbar/index.js +6 -6
- package/Scrollbar/index.js.map +1 -1
- package/Select/index.cjs +2 -2
- package/Select/index.cjs.map +1 -1
- package/Select/index.d.ts +5 -5
- package/Select/index.js +2 -2
- package/Select/index.js.map +1 -1
- package/Skeleton/index.cjs +7 -5
- package/Skeleton/index.cjs.map +1 -1
- package/Skeleton/index.js +7 -5
- package/Skeleton/index.js.map +1 -1
- package/Stack/index.d.ts +2 -2
- package/Switch/index.cjs +2 -2
- package/Switch/index.cjs.map +1 -1
- package/Switch/index.d.ts +3 -3
- package/Switch/index.js +2 -2
- package/Switch/index.js.map +1 -1
- package/Tab/index.cjs +23 -2
- package/Tab/index.cjs.map +1 -1
- package/Tab/index.d.ts +2 -2
- package/Tab/index.js +25 -4
- package/Tab/index.js.map +1 -1
- package/Table/index.cjs +9 -9
- package/Table/index.cjs.map +1 -1
- package/Table/index.d.ts +2 -2
- package/Table/index.js +9 -9
- package/Table/index.js.map +1 -1
- package/TableBody/index.d.ts +2 -2
- package/TableCell/index.cjs +1 -1
- package/TableCell/index.cjs.map +1 -1
- package/TableCell/index.d.ts +2 -2
- package/TableCell/index.js +1 -1
- package/TableCell/index.js.map +1 -1
- package/TableFooter/index.d.ts +2 -2
- package/TableHead/index.d.ts +2 -2
- package/TablePagination/index.cjs +2 -2
- package/TablePagination/index.cjs.map +1 -1
- package/TablePagination/index.d.ts +2 -2
- package/TablePagination/index.js +2 -2
- package/TablePagination/index.js.map +1 -1
- package/TableRow/index.d.ts +2 -2
- package/Tabs/context.cjs +11 -0
- package/Tabs/context.cjs.map +1 -0
- package/Tabs/context.js +8 -0
- package/Tabs/context.js.map +1 -0
- package/Tabs/index.cjs +83 -168
- package/Tabs/index.cjs.map +1 -1
- package/Tabs/index.d.ts +4 -22
- package/Tabs/index.js +86 -171
- package/Tabs/index.js.map +1 -1
- package/Tabs/types.d.ts +16 -0
- package/Text/index.cjs +1 -1
- package/Text/index.cjs.map +1 -1
- package/Text/index.d.ts +2 -2
- package/Text/index.js +1 -1
- package/Text/index.js.map +1 -1
- package/Toast/index.cjs +15 -16
- package/Toast/index.cjs.map +1 -1
- package/Toast/index.js +16 -17
- package/Toast/index.js.map +1 -1
- package/Tooltip/index.cjs +2 -2
- package/Tooltip/index.cjs.map +1 -1
- package/Tooltip/index.js +2 -2
- package/Tooltip/index.js.map +1 -1
- package/ViewBox/index.d.ts +2 -2
- package/index.cjs +124 -110
- package/index.cjs.map +1 -1
- package/index.d.ts +8 -1
- package/index.js +8 -1
- package/index.js.map +1 -1
- package/package.json +2 -2
- package/readme.md +1 -1
- package/useBlurCss/index.cjs +1 -2
- package/useBlurCss/index.cjs.map +1 -1
- package/useBlurCss/index.js +1 -2
- package/useBlurCss/index.js.map +1 -1
- package/useContextMenu/index.cjs +2 -2
- package/useContextMenu/index.cjs.map +1 -1
- package/useContextMenu/index.d.ts +1 -1
- package/useContextMenu/index.js +2 -2
- package/useContextMenu/index.js.map +1 -1
- package/Paper/index.cjs +0 -16
- package/Paper/index.cjs.map +0 -1
- package/Paper/index.d.ts +0 -8
- package/Paper/index.js +0 -14
- package/Paper/index.js.map +0 -1
package/Checkbox/index.js
CHANGED
|
@@ -29,7 +29,7 @@ const Checkbox = React.forwardRef((props, ref) => {
|
|
|
29
29
|
const [c, set] = useState(false);
|
|
30
30
|
checked !== null && checked !== void 0 ? checked : (checked = c);
|
|
31
31
|
size !== null && size !== void 0 ? size : (size = "medium");
|
|
32
|
-
color !== null && color !== void 0 ? color : (color = "
|
|
32
|
+
color !== null && color !== void 0 ? color : (color = "primary");
|
|
33
33
|
onChange = onChange || (() => set(!c));
|
|
34
34
|
if (indeterminate) {
|
|
35
35
|
checked = true;
|
|
@@ -45,7 +45,7 @@ const Checkbox = React.forwardRef((props, ref) => {
|
|
|
45
45
|
}
|
|
46
46
|
return (jsxs(Fragment, { children: [jsx(Tag, { baseClass: 'checkbox', onClick: () => {
|
|
47
47
|
onChange && onChange();
|
|
48
|
-
}, sxr: Object.assign({ height: size, width: size, display: "flex", alignItems: "center", justifyContent: "center", color: checked ? color : "
|
|
48
|
+
}, sxr: Object.assign({ height: size, width: size, display: "flex", alignItems: "center", justifyContent: "center", color: checked ? color : "surface.muted", cursor: "pointer", disabled: disabled, "& svg": {
|
|
49
49
|
fontSize: size
|
|
50
50
|
} }, rest === null || rest === void 0 ? void 0 : rest.sx), children: checked ? (checkIcon || jsx(CheckIcon, {})) : (uncheckIcon || jsx(UnCheckIcon, {})) }), jsx(Tag, Object.assign({}, rest, { component: 'input', ref: ref, readOnly: true, type: "checkbox", checked: checked, sxr: {
|
|
51
51
|
display: "none!important"
|
package/Checkbox/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/Checkbox/index.tsx"],"sourcesContent":["\"use client\";\nimport React, { useState, ReactElement } from 'react';\nimport { Tag, useInterface, UseColorTemplateColor, TagProps, useBreakpointProps, useBreakpointPropsType } from '@xanui/core';\nimport CheckIcon from '@xanui/icons/CheckBox'\nimport UnCheckIcon from '@xanui/icons/CheckBoxOutlineBlank'\nimport IndeterminateCheckBoxIcon from '@xanui/icons/IndeterminateCheckBox';\n\n\nexport type CheckboxProps = Omit<TagProps<\"input\">, \"color\" | \"size\" | \"component\" | \"type\" | \"checked\"> & {\n checkIcon?: useBreakpointPropsType<ReactElement>;\n uncheckIcon?: useBreakpointPropsType<ReactElement>;\n indeterminate?: useBreakpointPropsType<boolean>;\n checked?: boolean;\n size?: useBreakpointPropsType<number | \"small\" | \"medium\" | \"large\">;\n color?: useBreakpointPropsType<UseColorTemplateColor>;\n}\n\nconst Checkbox = React.forwardRef((props: CheckboxProps, ref?: React.Ref<any>) => {\n let [{ color, size, checkIcon, uncheckIcon, checked, indeterminate, disabled, onChange, ...rest }] = useInterface<any>(\"Checkbox\", props, {})\n const _p: any = {}\n if (checkIcon) _p.checkIcon = checkIcon\n if (uncheckIcon) _p.uncheckIcon = uncheckIcon\n if (indeterminate) _p.indeterminate = indeterminate\n if (size) _p.size = size\n if (color) _p.color = color\n const p: any = useBreakpointProps(_p)\n\n checkIcon = p.checkIcon\n uncheckIcon = p.uncheckIcon\n indeterminate = p.indeterminate\n size = p.size\n color = p.color\n\n const [c, set] = useState(false)\n checked ??= c\n size ??= \"medium\"\n color ??= \"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/Checkbox/index.tsx"],"sourcesContent":["\"use client\";\nimport React, { useState, ReactElement } from 'react';\nimport { Tag, useInterface, UseColorTemplateColor, TagProps, useBreakpointProps, useBreakpointPropsType } from '@xanui/core';\nimport CheckIcon from '@xanui/icons/CheckBox'\nimport UnCheckIcon from '@xanui/icons/CheckBoxOutlineBlank'\nimport IndeterminateCheckBoxIcon from '@xanui/icons/IndeterminateCheckBox';\n\n\nexport type CheckboxProps = Omit<TagProps<\"input\">, \"color\" | \"size\" | \"component\" | \"type\" | \"checked\"> & {\n checkIcon?: useBreakpointPropsType<ReactElement>;\n uncheckIcon?: useBreakpointPropsType<ReactElement>;\n indeterminate?: useBreakpointPropsType<boolean>;\n checked?: boolean;\n size?: useBreakpointPropsType<number | \"small\" | \"medium\" | \"large\">;\n color?: useBreakpointPropsType<UseColorTemplateColor>;\n}\n\nconst Checkbox = React.forwardRef((props: CheckboxProps, ref?: React.Ref<any>) => {\n let [{ color, size, checkIcon, uncheckIcon, checked, indeterminate, disabled, onChange, ...rest }] = useInterface<any>(\"Checkbox\", props, {})\n const _p: any = {}\n if (checkIcon) _p.checkIcon = checkIcon\n if (uncheckIcon) _p.uncheckIcon = uncheckIcon\n if (indeterminate) _p.indeterminate = indeterminate\n if (size) _p.size = size\n if (color) _p.color = color\n const p: any = useBreakpointProps(_p)\n\n checkIcon = p.checkIcon\n uncheckIcon = p.uncheckIcon\n indeterminate = p.indeterminate\n size = p.size\n color = p.color\n\n const [c, set] = useState(false)\n checked ??= c\n size ??= \"medium\"\n color ??= \"primary\"\n\n onChange = onChange || (() => set(!c));\n if (indeterminate) {\n checked = true\n checkIcon = <IndeterminateCheckBoxIcon />\n }\n\n let sizes: any = {\n small: 22,\n medium: 24,\n large: 32\n }\n\n if (typeof size === 'string' && sizes[size]) {\n size = sizes[size]\n }\n\n return (\n <>\n <Tag\n baseClass='checkbox'\n onClick={() => {\n onChange && onChange()\n }}\n sxr={{\n height: size,\n width: size,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n color: checked ? color : \"surface.muted\",\n cursor: \"pointer\",\n disabled: disabled,\n \"& svg\": {\n fontSize: size\n },\n ...rest?.sx\n }}\n >\n {checked ? (checkIcon || <CheckIcon />) : (uncheckIcon || <UnCheckIcon />)}\n </Tag>\n <Tag\n {...rest}\n component='input'\n ref={ref}\n readOnly\n type=\"checkbox\"\n checked={checked}\n sxr={{\n display: \"none!important\"\n }}\n />\n </>\n )\n})\n\nexport default Checkbox\n"],"names":[],"mappings":";;;;;;;;;AAiBA;AACI;;AAEA;AAAe;AACf;AAAiB;AACjB;AAAmB;AACnB;AAAU;AACV;AAAW;AACX;AAEA;AACA;AACA;AACA;AACA;;;;;AAOA;;;AAGI;;AAGJ;AACI;AACA;AACA;;;AAIA;;AAGJ;;;AAiBoB;;AAeJ;;AAKpB;;"}
|
package/Chip/index.cjs
CHANGED
|
@@ -30,7 +30,7 @@ const Chip = React.forwardRef((props, ref) => {
|
|
|
30
30
|
label = p.label;
|
|
31
31
|
startIcon = p.startIcon;
|
|
32
32
|
endIcon = p.endIcon;
|
|
33
|
-
color = p.color || "
|
|
33
|
+
color = p.color || "primary";
|
|
34
34
|
variant = p.variant || "fill";
|
|
35
35
|
corner = p.corner || "circle";
|
|
36
36
|
size = p.size || "medium";
|
|
@@ -58,7 +58,7 @@ const Chip = React.forwardRef((props, ref) => {
|
|
|
58
58
|
px: startIcon || endIcon ? .8 : 1.5,
|
|
59
59
|
}
|
|
60
60
|
};
|
|
61
|
-
return (jsxRuntime.jsxs(core.Tag, Object.assign({}, cornerCss, template.
|
|
61
|
+
return (jsxRuntime.jsxs(core.Tag, Object.assign({}, cornerCss, template.main, (sizes[size] || {}), rest, { sxr: {
|
|
62
62
|
display: "inline-flex",
|
|
63
63
|
flexDirection: "row",
|
|
64
64
|
alignItems: "center",
|
|
@@ -73,7 +73,7 @@ const Chip = React.forwardRef((props, ref) => {
|
|
|
73
73
|
}, baseClass: 'chip', ref: ref, children: [startIcon, jsxRuntime.jsx(core.Tag, Object.assign({}, slotProps === null || slotProps === void 0 ? void 0 : slotProps.label, { baseClass: 'chip-label', sxr: {
|
|
74
74
|
alignItems: "center",
|
|
75
75
|
flexBox: true,
|
|
76
|
-
color: template.
|
|
76
|
+
color: template.main.color + "!important"
|
|
77
77
|
}, children: label })), endIcon] })));
|
|
78
78
|
});
|
|
79
79
|
|
package/Chip/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../src/Chip/index.tsx"],"sourcesContent":["\"use client\"\nimport React, { ReactElement } from 'react';\nimport { Tag, TagProps, TagComponentType, useInterface, useColorTemplate, UseColorTemplateColor, UseColorTemplateType, useBreakpointProps, useBreakpointPropsType } from '@xanui/core';\nimport useCorner, { UseCornerTypes } from '../useCorner'\n\n\n\nexport type ChipProps<T extends TagComponentType = 'div'> = Omit<TagProps<T>, \"color\" | \"children\" | \"size\"> & {\n label: useBreakpointPropsType<string | ReactElement>;\n startIcon?: useBreakpointPropsType<ReactElement>;\n endIcon?: useBreakpointPropsType<ReactElement>;\n color?: useBreakpointPropsType<UseColorTemplateColor>;\n variant?: useBreakpointPropsType<UseColorTemplateType>;\n corner?: useBreakpointPropsType<UseCornerTypes>;\n size?: useBreakpointPropsType<\"small\" | \"medium\" | \"large\">;\n\n slotProps?: {\n label?: Omit<TagProps<\"div\">, \"children\">\n }\n}\n\n\nconst Chip = React.forwardRef(<T extends TagComponentType = 'div'>(props: ChipProps<T>, ref: React.Ref<any>) => {\n let [{ label, variant, startIcon, endIcon, color, corner, size, slotProps, ...rest }] = useInterface<any>(\"Chip\", props, {})\n const _p: any = {}\n if (label) _p.label = label\n if (startIcon) _p.startIcon = startIcon\n if (endIcon) _p.endIcon = endIcon\n if (color) _p.color = color\n if (variant) _p.variant = variant\n if (corner) _p.corner = corner\n if (size) _p.size = size\n if (slotProps) _p.slotProps = slotProps\n const p: any = useBreakpointProps(_p)\n\n label = p.label\n startIcon = p.startIcon\n endIcon = p.endIcon\n color = p.color || \"
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../src/Chip/index.tsx"],"sourcesContent":["\"use client\"\nimport React, { ReactElement } from 'react';\nimport { Tag, TagProps, TagComponentType, useInterface, useColorTemplate, UseColorTemplateColor, UseColorTemplateType, useBreakpointProps, useBreakpointPropsType } from '@xanui/core';\nimport useCorner, { UseCornerTypes } from '../useCorner'\n\n\n\nexport type ChipProps<T extends TagComponentType = 'div'> = Omit<TagProps<T>, \"color\" | \"children\" | \"size\"> & {\n label: useBreakpointPropsType<string | ReactElement>;\n startIcon?: useBreakpointPropsType<ReactElement>;\n endIcon?: useBreakpointPropsType<ReactElement>;\n color?: useBreakpointPropsType<UseColorTemplateColor>;\n variant?: useBreakpointPropsType<UseColorTemplateType>;\n corner?: useBreakpointPropsType<UseCornerTypes>;\n size?: useBreakpointPropsType<\"small\" | \"medium\" | \"large\">;\n\n slotProps?: {\n label?: Omit<TagProps<\"div\">, \"children\">\n }\n}\n\n\nconst Chip = React.forwardRef(<T extends TagComponentType = 'div'>(props: ChipProps<T>, ref: React.Ref<any>) => {\n let [{ label, variant, startIcon, endIcon, color, corner, size, slotProps, ...rest }] = useInterface<any>(\"Chip\", props, {})\n const _p: any = {}\n if (label) _p.label = label\n if (startIcon) _p.startIcon = startIcon\n if (endIcon) _p.endIcon = endIcon\n if (color) _p.color = color\n if (variant) _p.variant = variant\n if (corner) _p.corner = corner\n if (size) _p.size = size\n if (slotProps) _p.slotProps = slotProps\n const p: any = useBreakpointProps(_p)\n\n label = p.label\n startIcon = p.startIcon\n endIcon = p.endIcon\n color = p.color || \"primary\"\n variant = p.variant || \"fill\"\n corner = p.corner || \"circle\"\n size = p.size || \"medium\"\n slotProps = p.slotProps\n rest.sx = (rest as any).sx || {};\n\n const cornerCss = useCorner(corner)\n const template = useColorTemplate(color, variant)\n\n const sizes: any = {\n small: {\n height: 24,\n gap: .5,\n px: startIcon || endIcon ? .8 : 1,\n fontSize: \"small\"\n },\n medium: {\n height: 32,\n gap: 1,\n px: startIcon || endIcon ? .8 : 1.5,\n fontSize: 'button',\n },\n large: {\n height: 40,\n fontSize: 'text',\n gap: 1,\n px: startIcon || endIcon ? .8 : 1.5,\n }\n }\n\n return (\n <Tag\n {...cornerCss}\n {...template.main}\n {...(sizes[size as any] || {})}\n {...rest}\n sxr={{\n display: \"inline-flex\",\n flexDirection: \"row\",\n alignItems: \"center\",\n transition: \"background .3s\",\n overflow: \"hidden\",\n\n \"& > *\": {\n flex: \"0 0 auto\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n overflow: \"hidden\",\n },\n }}\n baseClass='chip'\n ref={ref}\n >\n {startIcon}\n <Tag\n {...slotProps?.label}\n baseClass='chip-label'\n sxr={{\n alignItems: \"center\",\n flexBox: true,\n color: template.main.color + \"!important\"\n }}\n >{label}</Tag>\n {endIcon}\n </Tag>\n )\n})\n\nexport default Chip\n"],"names":[],"mappings":";;;;;;;;;AAsBA;AACI;;AAEA;AAAW;AACX;AAAe;AACf;AAAa;AACb;AAAW;AACX;AAAa;AACb;AAAY;AACZ;AAAU;AACV;AAAe;AACf;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;;AAGA;AACI;AACI;AACA;;AAEA;AACH;AACD;AACI;AACA;;AAEA;AACH;AACD;AACI;AACA;AACA;;AAEH;;;AAUO;AACA;AACA;AACA;AACA;AAEA;AACI;AACA;AACA;AACA;AACH;;AAUG;AACA;AACA;AACH;AAKjB;;"}
|
package/Chip/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default, { ReactElement } from 'react';
|
|
2
2
|
import { TagComponentType, TagProps, useBreakpointPropsType, UseColorTemplateColor, UseColorTemplateType } from '@xanui/core';
|
|
3
3
|
import { UseCornerTypes } from '../useCorner/index.js';
|
|
4
4
|
|
|
@@ -14,7 +14,7 @@ type ChipProps<T extends TagComponentType = 'div'> = Omit<TagProps<T>, "color" |
|
|
|
14
14
|
label?: Omit<TagProps<"div">, "children">;
|
|
15
15
|
};
|
|
16
16
|
};
|
|
17
|
-
declare const Chip:
|
|
17
|
+
declare const Chip: React__default.ForwardRefExoticComponent<Omit<ChipProps<TagComponentType>, "ref"> & React__default.RefAttributes<any>>;
|
|
18
18
|
|
|
19
19
|
export { Chip as default };
|
|
20
20
|
export type { ChipProps };
|
package/Chip/index.js
CHANGED
|
@@ -28,7 +28,7 @@ const Chip = React.forwardRef((props, ref) => {
|
|
|
28
28
|
label = p.label;
|
|
29
29
|
startIcon = p.startIcon;
|
|
30
30
|
endIcon = p.endIcon;
|
|
31
|
-
color = p.color || "
|
|
31
|
+
color = p.color || "primary";
|
|
32
32
|
variant = p.variant || "fill";
|
|
33
33
|
corner = p.corner || "circle";
|
|
34
34
|
size = p.size || "medium";
|
|
@@ -56,7 +56,7 @@ const Chip = React.forwardRef((props, ref) => {
|
|
|
56
56
|
px: startIcon || endIcon ? .8 : 1.5,
|
|
57
57
|
}
|
|
58
58
|
};
|
|
59
|
-
return (jsxs(Tag, Object.assign({}, cornerCss, template.
|
|
59
|
+
return (jsxs(Tag, Object.assign({}, cornerCss, template.main, (sizes[size] || {}), rest, { sxr: {
|
|
60
60
|
display: "inline-flex",
|
|
61
61
|
flexDirection: "row",
|
|
62
62
|
alignItems: "center",
|
|
@@ -71,7 +71,7 @@ const Chip = React.forwardRef((props, ref) => {
|
|
|
71
71
|
}, baseClass: 'chip', ref: ref, children: [startIcon, jsx(Tag, Object.assign({}, slotProps === null || slotProps === void 0 ? void 0 : slotProps.label, { baseClass: 'chip-label', sxr: {
|
|
72
72
|
alignItems: "center",
|
|
73
73
|
flexBox: true,
|
|
74
|
-
color: template.
|
|
74
|
+
color: template.main.color + "!important"
|
|
75
75
|
}, children: label })), endIcon] })));
|
|
76
76
|
});
|
|
77
77
|
|
package/Chip/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/Chip/index.tsx"],"sourcesContent":["\"use client\"\nimport React, { ReactElement } from 'react';\nimport { Tag, TagProps, TagComponentType, useInterface, useColorTemplate, UseColorTemplateColor, UseColorTemplateType, useBreakpointProps, useBreakpointPropsType } from '@xanui/core';\nimport useCorner, { UseCornerTypes } from '../useCorner'\n\n\n\nexport type ChipProps<T extends TagComponentType = 'div'> = Omit<TagProps<T>, \"color\" | \"children\" | \"size\"> & {\n label: useBreakpointPropsType<string | ReactElement>;\n startIcon?: useBreakpointPropsType<ReactElement>;\n endIcon?: useBreakpointPropsType<ReactElement>;\n color?: useBreakpointPropsType<UseColorTemplateColor>;\n variant?: useBreakpointPropsType<UseColorTemplateType>;\n corner?: useBreakpointPropsType<UseCornerTypes>;\n size?: useBreakpointPropsType<\"small\" | \"medium\" | \"large\">;\n\n slotProps?: {\n label?: Omit<TagProps<\"div\">, \"children\">\n }\n}\n\n\nconst Chip = React.forwardRef(<T extends TagComponentType = 'div'>(props: ChipProps<T>, ref: React.Ref<any>) => {\n let [{ label, variant, startIcon, endIcon, color, corner, size, slotProps, ...rest }] = useInterface<any>(\"Chip\", props, {})\n const _p: any = {}\n if (label) _p.label = label\n if (startIcon) _p.startIcon = startIcon\n if (endIcon) _p.endIcon = endIcon\n if (color) _p.color = color\n if (variant) _p.variant = variant\n if (corner) _p.corner = corner\n if (size) _p.size = size\n if (slotProps) _p.slotProps = slotProps\n const p: any = useBreakpointProps(_p)\n\n label = p.label\n startIcon = p.startIcon\n endIcon = p.endIcon\n color = p.color || \"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/Chip/index.tsx"],"sourcesContent":["\"use client\"\nimport React, { ReactElement } from 'react';\nimport { Tag, TagProps, TagComponentType, useInterface, useColorTemplate, UseColorTemplateColor, UseColorTemplateType, useBreakpointProps, useBreakpointPropsType } from '@xanui/core';\nimport useCorner, { UseCornerTypes } from '../useCorner'\n\n\n\nexport type ChipProps<T extends TagComponentType = 'div'> = Omit<TagProps<T>, \"color\" | \"children\" | \"size\"> & {\n label: useBreakpointPropsType<string | ReactElement>;\n startIcon?: useBreakpointPropsType<ReactElement>;\n endIcon?: useBreakpointPropsType<ReactElement>;\n color?: useBreakpointPropsType<UseColorTemplateColor>;\n variant?: useBreakpointPropsType<UseColorTemplateType>;\n corner?: useBreakpointPropsType<UseCornerTypes>;\n size?: useBreakpointPropsType<\"small\" | \"medium\" | \"large\">;\n\n slotProps?: {\n label?: Omit<TagProps<\"div\">, \"children\">\n }\n}\n\n\nconst Chip = React.forwardRef(<T extends TagComponentType = 'div'>(props: ChipProps<T>, ref: React.Ref<any>) => {\n let [{ label, variant, startIcon, endIcon, color, corner, size, slotProps, ...rest }] = useInterface<any>(\"Chip\", props, {})\n const _p: any = {}\n if (label) _p.label = label\n if (startIcon) _p.startIcon = startIcon\n if (endIcon) _p.endIcon = endIcon\n if (color) _p.color = color\n if (variant) _p.variant = variant\n if (corner) _p.corner = corner\n if (size) _p.size = size\n if (slotProps) _p.slotProps = slotProps\n const p: any = useBreakpointProps(_p)\n\n label = p.label\n startIcon = p.startIcon\n endIcon = p.endIcon\n color = p.color || \"primary\"\n variant = p.variant || \"fill\"\n corner = p.corner || \"circle\"\n size = p.size || \"medium\"\n slotProps = p.slotProps\n rest.sx = (rest as any).sx || {};\n\n const cornerCss = useCorner(corner)\n const template = useColorTemplate(color, variant)\n\n const sizes: any = {\n small: {\n height: 24,\n gap: .5,\n px: startIcon || endIcon ? .8 : 1,\n fontSize: \"small\"\n },\n medium: {\n height: 32,\n gap: 1,\n px: startIcon || endIcon ? .8 : 1.5,\n fontSize: 'button',\n },\n large: {\n height: 40,\n fontSize: 'text',\n gap: 1,\n px: startIcon || endIcon ? .8 : 1.5,\n }\n }\n\n return (\n <Tag\n {...cornerCss}\n {...template.main}\n {...(sizes[size as any] || {})}\n {...rest}\n sxr={{\n display: \"inline-flex\",\n flexDirection: \"row\",\n alignItems: \"center\",\n transition: \"background .3s\",\n overflow: \"hidden\",\n\n \"& > *\": {\n flex: \"0 0 auto\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n overflow: \"hidden\",\n },\n }}\n baseClass='chip'\n ref={ref}\n >\n {startIcon}\n <Tag\n {...slotProps?.label}\n baseClass='chip-label'\n sxr={{\n alignItems: \"center\",\n flexBox: true,\n color: template.main.color + \"!important\"\n }}\n >{label}</Tag>\n {endIcon}\n </Tag>\n )\n})\n\nexport default Chip\n"],"names":[],"mappings":";;;;;;;AAsBA;AACI;;AAEA;AAAW;AACX;AAAe;AACf;AAAa;AACb;AAAW;AACX;AAAa;AACb;AAAY;AACZ;AAAU;AACV;AAAe;AACf;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;;AAGA;AACI;AACI;AACA;;AAEA;AACH;AACD;AACI;AACA;;AAEA;AACH;AACD;AACI;AACA;AACA;;AAEH;;;AAUO;AACA;AACA;AACA;AACA;AAEA;AACI;AACA;AACA;AACA;AACH;;AAUG;AACA;AACA;AACH;AAKjB;;"}
|
package/CircleProgress/index.cjs
CHANGED
|
@@ -32,7 +32,7 @@ const CircleProgress = React.forwardRef((_a, ref) => {
|
|
|
32
32
|
if (speed)
|
|
33
33
|
_p.speed = speed;
|
|
34
34
|
const p = core.useBreakpointProps(_p);
|
|
35
|
-
color = (_b = p.color) !== null && _b !== void 0 ? _b : "
|
|
35
|
+
color = (_b = p.color) !== null && _b !== void 0 ? _b : "primary";
|
|
36
36
|
trackColor = p.trackColor;
|
|
37
37
|
thumbColor = p.thumbColor;
|
|
38
38
|
size = (_c = p.size) !== null && _c !== void 0 ? _c : "medium";
|
|
@@ -41,16 +41,16 @@ const CircleProgress = React.forwardRef((_a, ref) => {
|
|
|
41
41
|
value = p.value;
|
|
42
42
|
hideTrack = p.hideTrack;
|
|
43
43
|
showPercentage = p.showPercentage;
|
|
44
|
-
speed = (_e = p.speed) !== null && _e !== void 0 ? _e : 1.
|
|
45
|
-
if (trackColor === '
|
|
46
|
-
trackColor = "divider";
|
|
44
|
+
speed = (_e = p.speed) !== null && _e !== void 0 ? _e : 1.5;
|
|
45
|
+
if (trackColor === 'surface') {
|
|
46
|
+
trackColor = "surface.divider";
|
|
47
47
|
}
|
|
48
|
-
if (thumbColor === '
|
|
49
|
-
thumbColor = "
|
|
48
|
+
if (thumbColor === 'surface') {
|
|
49
|
+
thumbColor = "surface.contrast";
|
|
50
50
|
}
|
|
51
51
|
let sizes = {
|
|
52
52
|
small: 24,
|
|
53
|
-
medium:
|
|
53
|
+
medium: 34,
|
|
54
54
|
large: 44
|
|
55
55
|
};
|
|
56
56
|
if (typeof size === 'string' && sizes[size]) {
|
|
@@ -65,7 +65,7 @@ const CircleProgress = React.forwardRef((_a, ref) => {
|
|
|
65
65
|
const percent = circumference - ((value || 0) / 100) * circumference;
|
|
66
66
|
if (showPercentage && !children) {
|
|
67
67
|
children = jsxRuntime.jsxs(core.Tag, { sxr: {
|
|
68
|
-
color: color === '
|
|
68
|
+
color: color === 'surface' ? "surface.contrast" : `${color}.main`,
|
|
69
69
|
fontSize: size / 4
|
|
70
70
|
}, children: [value, "%"] });
|
|
71
71
|
}
|
|
@@ -91,7 +91,7 @@ const CircleProgress = React.forwardRef((_a, ref) => {
|
|
|
91
91
|
"& circle.circle-progress-thumb": {
|
|
92
92
|
strokeDasharray: circumference,
|
|
93
93
|
strokeDashoffset: percent,
|
|
94
|
-
stroke: thumbColor || (color === '
|
|
94
|
+
stroke: thumbColor || (color === 'surface' ? `surface.contrast` : `${color}.main`),
|
|
95
95
|
fill: "none",
|
|
96
96
|
strokeWidth: thumbSize,
|
|
97
97
|
strokeLinecap: "round",
|
|
@@ -104,7 +104,7 @@ const CircleProgress = React.forwardRef((_a, ref) => {
|
|
|
104
104
|
},
|
|
105
105
|
"& circle.circle-progress-track": {
|
|
106
106
|
fill: "none",
|
|
107
|
-
stroke: trackColor || (
|
|
107
|
+
stroke: trackColor || (`surface.divider`),
|
|
108
108
|
strokeWidth: trackSize !== null && trackSize !== void 0 ? trackSize : thumbSize,
|
|
109
109
|
}
|
|
110
110
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../src/CircleProgress/index.tsx"],"sourcesContent":["\"use client\";\nimport React, { ReactElement, useId } from \"react\"\nimport { Tag, UseColorTemplateColor, useInterface, useBreakpointProps, useBreakpointPropsType } from '@xanui/core';\n\nexport type CircleProgressProps = {\n children?: ReactElement;\n color?: useBreakpointPropsType<UseColorTemplateColor>;\n trackColor?: useBreakpointPropsType<UseColorTemplateColor>;\n thumbColor?: useBreakpointPropsType<UseColorTemplateColor>;\n size?: useBreakpointPropsType<number | \"small\" | \"medium\" | \"large\">;\n thumbSize?: useBreakpointPropsType<number>;\n trackSize?: useBreakpointPropsType<number>;\n value?: useBreakpointPropsType<number>;\n hideTrack?: useBreakpointPropsType<boolean>;\n showPercentage?: useBreakpointPropsType<boolean>;\n speed?: useBreakpointPropsType<number>;\n}\n\nconst CircleProgress = React.forwardRef(({ children, ...props }: CircleProgressProps, ref: React.Ref<any>) => {\n let [{ color, trackColor, thumbColor, size, value, thumbSize, hideTrack, trackSize, showPercentage, speed }] = useInterface<any>(\"CircleProgress\", props, {})\n const _p: any = {}\n if (color) _p.color = color\n if (trackColor) _p.trackColor = trackColor\n if (thumbColor) _p.thumbColor = thumbColor\n if (size) _p.size = size\n if (thumbSize) _p.thumbSize = thumbSize\n if (trackSize) _p.trackSize = trackSize\n if (value) _p.value = value\n if (hideTrack) _p.hideTrack = hideTrack\n if (showPercentage) _p.showPercentage = showPercentage\n if (speed) _p.speed = speed\n const p: any = useBreakpointProps(_p)\n\n color = p.color ?? \"
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../src/CircleProgress/index.tsx"],"sourcesContent":["\"use client\";\nimport React, { ReactElement, useId } from \"react\"\nimport { Tag, UseColorTemplateColor, useInterface, useBreakpointProps, useBreakpointPropsType } from '@xanui/core';\n\nexport type CircleProgressProps = {\n children?: ReactElement;\n color?: useBreakpointPropsType<UseColorTemplateColor>;\n trackColor?: useBreakpointPropsType<UseColorTemplateColor>;\n thumbColor?: useBreakpointPropsType<UseColorTemplateColor>;\n size?: useBreakpointPropsType<number | \"small\" | \"medium\" | \"large\">;\n thumbSize?: useBreakpointPropsType<number>;\n trackSize?: useBreakpointPropsType<number>;\n value?: useBreakpointPropsType<number>;\n hideTrack?: useBreakpointPropsType<boolean>;\n showPercentage?: useBreakpointPropsType<boolean>;\n speed?: useBreakpointPropsType<number>;\n}\n\nconst CircleProgress = React.forwardRef(({ children, ...props }: CircleProgressProps, ref: React.Ref<any>) => {\n let [{ color, trackColor, thumbColor, size, value, thumbSize, hideTrack, trackSize, showPercentage, speed }] = useInterface<any>(\"CircleProgress\", props, {})\n const _p: any = {}\n if (color) _p.color = color\n if (trackColor) _p.trackColor = trackColor\n if (thumbColor) _p.thumbColor = thumbColor\n if (size) _p.size = size\n if (thumbSize) _p.thumbSize = thumbSize\n if (trackSize) _p.trackSize = trackSize\n if (value) _p.value = value\n if (hideTrack) _p.hideTrack = hideTrack\n if (showPercentage) _p.showPercentage = showPercentage\n if (speed) _p.speed = speed\n const p: any = useBreakpointProps(_p)\n\n color = p.color ?? \"primary\"\n trackColor = p.trackColor\n thumbColor = p.thumbColor\n size = p.size ?? \"medium\"\n thumbSize = p.thumbSize ?? 4\n trackSize = p.trackSize\n value = p.value\n hideTrack = p.hideTrack\n showPercentage = p.showPercentage\n speed = p.speed ?? 1.5\n\n if (trackColor === 'surface') {\n trackColor = \"surface.divider\"\n }\n\n if (thumbColor === 'surface') {\n thumbColor = \"surface.contrast\"\n }\n\n\n let sizes: any = {\n small: 24,\n medium: 34,\n large: 44\n }\n if (typeof size === 'string' && sizes[size]) {\n size = sizes[size]\n }\n\n let isVal = typeof value === 'number'\n const animrotate = \"anim\" + useId().replace(\":\", \"\")\n const animdash = \"anim\" + useId().replace(\":\", \"\")\n if (isVal && (value as number) > 100) value = 100\n const circumference = 125.66370614359172 //radius * 2 * Math.PI\n const percent = circumference - ((value || 0) / 100) * circumference\n\n if (showPercentage && !children) {\n children = <Tag\n sxr={{\n color: color === 'surface' ? \"surface.contrast\" : `${color}.main`,\n fontSize: size / 4\n }}\n >{value}%</Tag>\n }\n\n return (\n <Tag\n baseClass='circle-progress'\n sxr={{\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n \"& svg[class='circle-progress-svg']\": {\n zIndex: 1,\n position: \"absolute\",\n top: 0,\n left: 0,\n width: \"100%\",\n height: \"100%\",\n transform: isVal ? \"rotate(-90deg)\" : \"none\",\n transformOrigin: isVal ? \"center\" : \"initial\",\n animation: isVal ? \"none\" : `${animrotate} ${speed}s linear infinite`,\n [`@keyframes ${animrotate}`]: {\n \"100%\": {\n transform: \"rotate(360deg)\"\n }\n },\n \"& circle.circle-progress-thumb\": {\n strokeDasharray: circumference,\n strokeDashoffset: percent,\n stroke: thumbColor || (color === 'surface' ? `surface.contrast` : `${color}.main`),\n fill: \"none\",\n strokeWidth: thumbSize,\n strokeLinecap: \"round\",\n animation: isVal ? \"none\" : `${animdash} ${speed}s ease-in-out infinite`,\n [`@keyframes ${animdash}`]: {\n \"0%\": { strokeDasharray: \"1, 150\", strokeDashoffset: 0 },\n \"50%\": { strokeDasharray: \"90, 150\", strokeDashoffset: -35 },\n \"100%\": { strokeDasharray: \"90, 150\", strokeDashoffset: -124 }\n }\n },\n \"& circle.circle-progress-track\": {\n fill: \"none\",\n stroke: trackColor || (`surface.divider`),\n strokeWidth: trackSize ?? thumbSize,\n }\n },\n width: size,\n height: size,\n position: \"relative\"\n }}\n ref={ref}\n >\n <svg viewBox=\"0 0 50 50\" className=\"circle-progress-svg\">\n {!hideTrack && <circle className=\"circle-progress-track\" cx=\"25\" cy=\"25\" r={20} />}\n <circle className=\"circle-progress-thumb\" cx=\"25\" cy=\"25\" r={20} />\n </svg>\n {!!children && <Tag\n baseClass=\"circle-progress-content\"\n sxr={{\n zIndex: 2,\n width: size - thumbSize,\n height: size - thumbSize,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n '& *': {\n maxWidth: size - (thumbSize + 8),\n maxHeight: size - (thumbSize + 8),\n }\n }}\n >\n {children}\n </Tag>}\n </Tag >\n )\n})\n\nexport default CircleProgress\n\n"],"names":[],"mappings":";;;;;;;;AAkBA;;AAAyC;AACrC;;AAEA;AAAW;AACX;AAAgB;AAChB;AAAgB;AAChB;AAAU;AACV;AAAe;AACf;AAAe;AACf;AAAW;AACX;AAAe;AACf;AAAoB;AACpB;AAAW;AACX;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;;;AAIA;;;AAKA;AACI;AACA;AACA;;;AAGA;;AAGJ;AACA;AACA;AACA;;AACA;AACA;AAEA;AACI;AAEQ;;;;;AAUA;AACA;AACA;AACA;AACI;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACI;AACI;AACH;AACJ;AACD;AACI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;AAIC;AACJ;AACD;AACI;AACA;AACA;AACH;AACJ;AACD;AACA;AACA;AACH;AAUO;;;AAGA;AACA;AACA;AACA;AACI;AACA;AACH;AACJ;AAMjB;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default, { ReactElement } from 'react';
|
|
2
2
|
import { useBreakpointPropsType, UseColorTemplateColor } from '@xanui/core';
|
|
3
3
|
|
|
4
4
|
type CircleProgressProps = {
|
|
@@ -14,7 +14,7 @@ type CircleProgressProps = {
|
|
|
14
14
|
showPercentage?: useBreakpointPropsType<boolean>;
|
|
15
15
|
speed?: useBreakpointPropsType<number>;
|
|
16
16
|
};
|
|
17
|
-
declare const CircleProgress:
|
|
17
|
+
declare const CircleProgress: React__default.ForwardRefExoticComponent<CircleProgressProps & React__default.RefAttributes<any>>;
|
|
18
18
|
|
|
19
19
|
export { CircleProgress as default };
|
|
20
20
|
export type { CircleProgressProps };
|
package/CircleProgress/index.js
CHANGED
|
@@ -30,7 +30,7 @@ const CircleProgress = React.forwardRef((_a, ref) => {
|
|
|
30
30
|
if (speed)
|
|
31
31
|
_p.speed = speed;
|
|
32
32
|
const p = useBreakpointProps(_p);
|
|
33
|
-
color = (_b = p.color) !== null && _b !== void 0 ? _b : "
|
|
33
|
+
color = (_b = p.color) !== null && _b !== void 0 ? _b : "primary";
|
|
34
34
|
trackColor = p.trackColor;
|
|
35
35
|
thumbColor = p.thumbColor;
|
|
36
36
|
size = (_c = p.size) !== null && _c !== void 0 ? _c : "medium";
|
|
@@ -39,16 +39,16 @@ const CircleProgress = React.forwardRef((_a, ref) => {
|
|
|
39
39
|
value = p.value;
|
|
40
40
|
hideTrack = p.hideTrack;
|
|
41
41
|
showPercentage = p.showPercentage;
|
|
42
|
-
speed = (_e = p.speed) !== null && _e !== void 0 ? _e : 1.
|
|
43
|
-
if (trackColor === '
|
|
44
|
-
trackColor = "divider";
|
|
42
|
+
speed = (_e = p.speed) !== null && _e !== void 0 ? _e : 1.5;
|
|
43
|
+
if (trackColor === 'surface') {
|
|
44
|
+
trackColor = "surface.divider";
|
|
45
45
|
}
|
|
46
|
-
if (thumbColor === '
|
|
47
|
-
thumbColor = "
|
|
46
|
+
if (thumbColor === 'surface') {
|
|
47
|
+
thumbColor = "surface.contrast";
|
|
48
48
|
}
|
|
49
49
|
let sizes = {
|
|
50
50
|
small: 24,
|
|
51
|
-
medium:
|
|
51
|
+
medium: 34,
|
|
52
52
|
large: 44
|
|
53
53
|
};
|
|
54
54
|
if (typeof size === 'string' && sizes[size]) {
|
|
@@ -63,7 +63,7 @@ const CircleProgress = React.forwardRef((_a, ref) => {
|
|
|
63
63
|
const percent = circumference - ((value || 0) / 100) * circumference;
|
|
64
64
|
if (showPercentage && !children) {
|
|
65
65
|
children = jsxs(Tag, { sxr: {
|
|
66
|
-
color: color === '
|
|
66
|
+
color: color === 'surface' ? "surface.contrast" : `${color}.main`,
|
|
67
67
|
fontSize: size / 4
|
|
68
68
|
}, children: [value, "%"] });
|
|
69
69
|
}
|
|
@@ -89,7 +89,7 @@ const CircleProgress = React.forwardRef((_a, ref) => {
|
|
|
89
89
|
"& circle.circle-progress-thumb": {
|
|
90
90
|
strokeDasharray: circumference,
|
|
91
91
|
strokeDashoffset: percent,
|
|
92
|
-
stroke: thumbColor || (color === '
|
|
92
|
+
stroke: thumbColor || (color === 'surface' ? `surface.contrast` : `${color}.main`),
|
|
93
93
|
fill: "none",
|
|
94
94
|
strokeWidth: thumbSize,
|
|
95
95
|
strokeLinecap: "round",
|
|
@@ -102,7 +102,7 @@ const CircleProgress = React.forwardRef((_a, ref) => {
|
|
|
102
102
|
},
|
|
103
103
|
"& circle.circle-progress-track": {
|
|
104
104
|
fill: "none",
|
|
105
|
-
stroke: trackColor || (
|
|
105
|
+
stroke: trackColor || (`surface.divider`),
|
|
106
106
|
strokeWidth: trackSize !== null && trackSize !== void 0 ? trackSize : thumbSize,
|
|
107
107
|
}
|
|
108
108
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/CircleProgress/index.tsx"],"sourcesContent":["\"use client\";\nimport React, { ReactElement, useId } from \"react\"\nimport { Tag, UseColorTemplateColor, useInterface, useBreakpointProps, useBreakpointPropsType } from '@xanui/core';\n\nexport type CircleProgressProps = {\n children?: ReactElement;\n color?: useBreakpointPropsType<UseColorTemplateColor>;\n trackColor?: useBreakpointPropsType<UseColorTemplateColor>;\n thumbColor?: useBreakpointPropsType<UseColorTemplateColor>;\n size?: useBreakpointPropsType<number | \"small\" | \"medium\" | \"large\">;\n thumbSize?: useBreakpointPropsType<number>;\n trackSize?: useBreakpointPropsType<number>;\n value?: useBreakpointPropsType<number>;\n hideTrack?: useBreakpointPropsType<boolean>;\n showPercentage?: useBreakpointPropsType<boolean>;\n speed?: useBreakpointPropsType<number>;\n}\n\nconst CircleProgress = React.forwardRef(({ children, ...props }: CircleProgressProps, ref: React.Ref<any>) => {\n let [{ color, trackColor, thumbColor, size, value, thumbSize, hideTrack, trackSize, showPercentage, speed }] = useInterface<any>(\"CircleProgress\", props, {})\n const _p: any = {}\n if (color) _p.color = color\n if (trackColor) _p.trackColor = trackColor\n if (thumbColor) _p.thumbColor = thumbColor\n if (size) _p.size = size\n if (thumbSize) _p.thumbSize = thumbSize\n if (trackSize) _p.trackSize = trackSize\n if (value) _p.value = value\n if (hideTrack) _p.hideTrack = hideTrack\n if (showPercentage) _p.showPercentage = showPercentage\n if (speed) _p.speed = speed\n const p: any = useBreakpointProps(_p)\n\n color = p.color ?? \"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/CircleProgress/index.tsx"],"sourcesContent":["\"use client\";\nimport React, { ReactElement, useId } from \"react\"\nimport { Tag, UseColorTemplateColor, useInterface, useBreakpointProps, useBreakpointPropsType } from '@xanui/core';\n\nexport type CircleProgressProps = {\n children?: ReactElement;\n color?: useBreakpointPropsType<UseColorTemplateColor>;\n trackColor?: useBreakpointPropsType<UseColorTemplateColor>;\n thumbColor?: useBreakpointPropsType<UseColorTemplateColor>;\n size?: useBreakpointPropsType<number | \"small\" | \"medium\" | \"large\">;\n thumbSize?: useBreakpointPropsType<number>;\n trackSize?: useBreakpointPropsType<number>;\n value?: useBreakpointPropsType<number>;\n hideTrack?: useBreakpointPropsType<boolean>;\n showPercentage?: useBreakpointPropsType<boolean>;\n speed?: useBreakpointPropsType<number>;\n}\n\nconst CircleProgress = React.forwardRef(({ children, ...props }: CircleProgressProps, ref: React.Ref<any>) => {\n let [{ color, trackColor, thumbColor, size, value, thumbSize, hideTrack, trackSize, showPercentage, speed }] = useInterface<any>(\"CircleProgress\", props, {})\n const _p: any = {}\n if (color) _p.color = color\n if (trackColor) _p.trackColor = trackColor\n if (thumbColor) _p.thumbColor = thumbColor\n if (size) _p.size = size\n if (thumbSize) _p.thumbSize = thumbSize\n if (trackSize) _p.trackSize = trackSize\n if (value) _p.value = value\n if (hideTrack) _p.hideTrack = hideTrack\n if (showPercentage) _p.showPercentage = showPercentage\n if (speed) _p.speed = speed\n const p: any = useBreakpointProps(_p)\n\n color = p.color ?? \"primary\"\n trackColor = p.trackColor\n thumbColor = p.thumbColor\n size = p.size ?? \"medium\"\n thumbSize = p.thumbSize ?? 4\n trackSize = p.trackSize\n value = p.value\n hideTrack = p.hideTrack\n showPercentage = p.showPercentage\n speed = p.speed ?? 1.5\n\n if (trackColor === 'surface') {\n trackColor = \"surface.divider\"\n }\n\n if (thumbColor === 'surface') {\n thumbColor = \"surface.contrast\"\n }\n\n\n let sizes: any = {\n small: 24,\n medium: 34,\n large: 44\n }\n if (typeof size === 'string' && sizes[size]) {\n size = sizes[size]\n }\n\n let isVal = typeof value === 'number'\n const animrotate = \"anim\" + useId().replace(\":\", \"\")\n const animdash = \"anim\" + useId().replace(\":\", \"\")\n if (isVal && (value as number) > 100) value = 100\n const circumference = 125.66370614359172 //radius * 2 * Math.PI\n const percent = circumference - ((value || 0) / 100) * circumference\n\n if (showPercentage && !children) {\n children = <Tag\n sxr={{\n color: color === 'surface' ? \"surface.contrast\" : `${color}.main`,\n fontSize: size / 4\n }}\n >{value}%</Tag>\n }\n\n return (\n <Tag\n baseClass='circle-progress'\n sxr={{\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n \"& svg[class='circle-progress-svg']\": {\n zIndex: 1,\n position: \"absolute\",\n top: 0,\n left: 0,\n width: \"100%\",\n height: \"100%\",\n transform: isVal ? \"rotate(-90deg)\" : \"none\",\n transformOrigin: isVal ? \"center\" : \"initial\",\n animation: isVal ? \"none\" : `${animrotate} ${speed}s linear infinite`,\n [`@keyframes ${animrotate}`]: {\n \"100%\": {\n transform: \"rotate(360deg)\"\n }\n },\n \"& circle.circle-progress-thumb\": {\n strokeDasharray: circumference,\n strokeDashoffset: percent,\n stroke: thumbColor || (color === 'surface' ? `surface.contrast` : `${color}.main`),\n fill: \"none\",\n strokeWidth: thumbSize,\n strokeLinecap: \"round\",\n animation: isVal ? \"none\" : `${animdash} ${speed}s ease-in-out infinite`,\n [`@keyframes ${animdash}`]: {\n \"0%\": { strokeDasharray: \"1, 150\", strokeDashoffset: 0 },\n \"50%\": { strokeDasharray: \"90, 150\", strokeDashoffset: -35 },\n \"100%\": { strokeDasharray: \"90, 150\", strokeDashoffset: -124 }\n }\n },\n \"& circle.circle-progress-track\": {\n fill: \"none\",\n stroke: trackColor || (`surface.divider`),\n strokeWidth: trackSize ?? thumbSize,\n }\n },\n width: size,\n height: size,\n position: \"relative\"\n }}\n ref={ref}\n >\n <svg viewBox=\"0 0 50 50\" className=\"circle-progress-svg\">\n {!hideTrack && <circle className=\"circle-progress-track\" cx=\"25\" cy=\"25\" r={20} />}\n <circle className=\"circle-progress-thumb\" cx=\"25\" cy=\"25\" r={20} />\n </svg>\n {!!children && <Tag\n baseClass=\"circle-progress-content\"\n sxr={{\n zIndex: 2,\n width: size - thumbSize,\n height: size - thumbSize,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n '& *': {\n maxWidth: size - (thumbSize + 8),\n maxHeight: size - (thumbSize + 8),\n }\n }}\n >\n {children}\n </Tag>}\n </Tag >\n )\n})\n\nexport default CircleProgress\n\n"],"names":[],"mappings":";;;;;;AAkBA;;AAAyC;AACrC;;AAEA;AAAW;AACX;AAAgB;AAChB;AAAgB;AAChB;AAAU;AACV;AAAe;AACf;AAAe;AACf;AAAW;AACX;AAAe;AACf;AAAoB;AACpB;AAAW;AACX;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;;;AAIA;;;AAKA;AACI;AACA;AACA;;;AAGA;;AAGJ;AACA;AACA;AACA;;AACA;AACA;AAEA;AACI;AAEQ;;;;;AAUA;AACA;AACA;AACA;AACI;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACI;AACI;AACH;AACJ;AACD;AACI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;AAIC;AACJ;AACD;AACI;AACA;AACA;AACH;AACJ;AACD;AACA;AACA;AACH;AAUO;;;AAGA;AACA;AACA;AACA;AACI;AACA;AACH;AACJ;AAMjB;;"}
|
package/ClickOutside/index.cjs
CHANGED
|
@@ -6,19 +6,10 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
6
6
|
var core = require('@xanui/core');
|
|
7
7
|
var React = require('react');
|
|
8
8
|
|
|
9
|
-
const ClickOutside = React.forwardRef((_a,
|
|
9
|
+
const ClickOutside = React.forwardRef((_a, ref) => {
|
|
10
10
|
var { children, onClickOutside } = _a, props = tslib.__rest(_a, ["children", "onClickOutside"]);
|
|
11
11
|
const innerRef = React.useRef(null);
|
|
12
|
-
|
|
13
|
-
const setRefs = (el) => {
|
|
14
|
-
innerRef.current = el;
|
|
15
|
-
if (typeof forwardedRef === "function") {
|
|
16
|
-
forwardedRef(el);
|
|
17
|
-
}
|
|
18
|
-
else if (forwardedRef) {
|
|
19
|
-
forwardedRef.current = el;
|
|
20
|
-
}
|
|
21
|
-
};
|
|
12
|
+
const mergeRef = core.useMergeRefs(ref, innerRef);
|
|
22
13
|
React.useEffect(() => {
|
|
23
14
|
const handler = (e) => {
|
|
24
15
|
if (!innerRef.current)
|
|
@@ -30,7 +21,7 @@ const ClickOutside = React.forwardRef((_a, forwardedRef) => {
|
|
|
30
21
|
document.addEventListener("mousedown", handler);
|
|
31
22
|
return () => document.removeEventListener("mousedown", handler);
|
|
32
23
|
}, [onClickOutside]);
|
|
33
|
-
return (jsxRuntime.jsx(core.Tag, Object.assign({ component: "div", display: "inline-block" }, props, { baseClass: 'click-outside', ref:
|
|
24
|
+
return (jsxRuntime.jsx(core.Tag, Object.assign({ component: "div", display: "inline-block" }, props, { baseClass: 'click-outside', ref: mergeRef, children: children })));
|
|
34
25
|
});
|
|
35
26
|
|
|
36
27
|
module.exports = ClickOutside;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../src/ClickOutside/index.tsx"],"sourcesContent":["\"use client\";\nimport { Tag, TagComponentType, TagProps } from '@xanui/core';\nimport React, { useEffect, useRef } from 'react';\n\nexport type ClickOutsideProps<T extends TagComponentType = \"div\"> = TagProps<T> & {\n onClickOutside: (e: MouseEvent) => void;\n children: React.ReactElement\n};\n\nconst ClickOutside = React.forwardRef(<T extends TagComponentType = \"div\">({ children, onClickOutside, ...props }: ClickOutsideProps<T>,
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../src/ClickOutside/index.tsx"],"sourcesContent":["\"use client\";\nimport { Tag, TagComponentType, TagProps, useMergeRefs } from '@xanui/core';\nimport React, { useEffect, useRef } from 'react';\n\nexport type ClickOutsideProps<T extends TagComponentType = \"div\"> = TagProps<T> & {\n onClickOutside: (e: MouseEvent) => void;\n children: React.ReactElement\n};\n\nconst ClickOutside = React.forwardRef(<T extends TagComponentType = \"div\">({ children, onClickOutside, ...props }: ClickOutsideProps<T>, ref: any) => {\n\n const innerRef = useRef<HTMLElement | null>(null);\n const mergeRef = useMergeRefs(ref, innerRef)\n\n useEffect(() => {\n const handler = (e: MouseEvent) => {\n\n if (!innerRef.current) return;\n\n if (!innerRef.current.contains(e.target as Node)) {\n onClickOutside(e);\n }\n };\n\n document.addEventListener(\"mousedown\", handler);\n return () => document.removeEventListener(\"mousedown\", handler);\n }, [onClickOutside]);\n\n return (\n <Tag\n component=\"div\"\n display=\"inline-block\"\n {...props}\n baseClass='click-outside'\n ref={mergeRef}\n >\n {children}\n </Tag>\n )\n});\n\nexport default ClickOutside;\n"],"names":[],"mappings":";;;;;;;;AASA;;AAEI;;;AAII;;;AAII;;;AAGJ;AAEA;;AAEJ;;AAaJ;;"}
|
package/ClickOutside/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { TagComponentType, TagProps } from '@xanui/core';
|
|
2
|
-
import
|
|
2
|
+
import React__default from 'react';
|
|
3
3
|
|
|
4
4
|
type ClickOutsideProps<T extends TagComponentType = "div"> = TagProps<T> & {
|
|
5
5
|
onClickOutside: (e: MouseEvent) => void;
|
|
6
|
-
children:
|
|
6
|
+
children: React__default.ReactElement;
|
|
7
7
|
};
|
|
8
|
-
declare const ClickOutside:
|
|
8
|
+
declare const ClickOutside: React__default.ForwardRefExoticComponent<Omit<ClickOutsideProps<TagComponentType>, "ref"> & React__default.RefAttributes<unknown>>;
|
|
9
9
|
|
|
10
10
|
export { ClickOutside as default };
|
|
11
11
|
export type { ClickOutsideProps };
|
package/ClickOutside/index.js
CHANGED
|
@@ -1,22 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { __rest } from 'tslib';
|
|
3
3
|
import { jsx } from 'react/jsx-runtime';
|
|
4
|
-
import { Tag } from '@xanui/core';
|
|
4
|
+
import { useMergeRefs, Tag } from '@xanui/core';
|
|
5
5
|
import React, { useRef, useEffect } from 'react';
|
|
6
6
|
|
|
7
|
-
const ClickOutside = React.forwardRef((_a,
|
|
7
|
+
const ClickOutside = React.forwardRef((_a, ref) => {
|
|
8
8
|
var { children, onClickOutside } = _a, props = __rest(_a, ["children", "onClickOutside"]);
|
|
9
9
|
const innerRef = useRef(null);
|
|
10
|
-
|
|
11
|
-
const setRefs = (el) => {
|
|
12
|
-
innerRef.current = el;
|
|
13
|
-
if (typeof forwardedRef === "function") {
|
|
14
|
-
forwardedRef(el);
|
|
15
|
-
}
|
|
16
|
-
else if (forwardedRef) {
|
|
17
|
-
forwardedRef.current = el;
|
|
18
|
-
}
|
|
19
|
-
};
|
|
10
|
+
const mergeRef = useMergeRefs(ref, innerRef);
|
|
20
11
|
useEffect(() => {
|
|
21
12
|
const handler = (e) => {
|
|
22
13
|
if (!innerRef.current)
|
|
@@ -28,7 +19,7 @@ const ClickOutside = React.forwardRef((_a, forwardedRef) => {
|
|
|
28
19
|
document.addEventListener("mousedown", handler);
|
|
29
20
|
return () => document.removeEventListener("mousedown", handler);
|
|
30
21
|
}, [onClickOutside]);
|
|
31
|
-
return (jsx(Tag, Object.assign({ component: "div", display: "inline-block" }, props, { baseClass: 'click-outside', ref:
|
|
22
|
+
return (jsx(Tag, Object.assign({ component: "div", display: "inline-block" }, props, { baseClass: 'click-outside', ref: mergeRef, children: children })));
|
|
32
23
|
});
|
|
33
24
|
|
|
34
25
|
export { ClickOutside as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/ClickOutside/index.tsx"],"sourcesContent":["\"use client\";\nimport { Tag, TagComponentType, TagProps } from '@xanui/core';\nimport React, { useEffect, useRef } from 'react';\n\nexport type ClickOutsideProps<T extends TagComponentType = \"div\"> = TagProps<T> & {\n onClickOutside: (e: MouseEvent) => void;\n children: React.ReactElement\n};\n\nconst ClickOutside = React.forwardRef(<T extends TagComponentType = \"div\">({ children, onClickOutside, ...props }: ClickOutsideProps<T>,
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/ClickOutside/index.tsx"],"sourcesContent":["\"use client\";\nimport { Tag, TagComponentType, TagProps, useMergeRefs } from '@xanui/core';\nimport React, { useEffect, useRef } from 'react';\n\nexport type ClickOutsideProps<T extends TagComponentType = \"div\"> = TagProps<T> & {\n onClickOutside: (e: MouseEvent) => void;\n children: React.ReactElement\n};\n\nconst ClickOutside = React.forwardRef(<T extends TagComponentType = \"div\">({ children, onClickOutside, ...props }: ClickOutsideProps<T>, ref: any) => {\n\n const innerRef = useRef<HTMLElement | null>(null);\n const mergeRef = useMergeRefs(ref, innerRef)\n\n useEffect(() => {\n const handler = (e: MouseEvent) => {\n\n if (!innerRef.current) return;\n\n if (!innerRef.current.contains(e.target as Node)) {\n onClickOutside(e);\n }\n };\n\n document.addEventListener(\"mousedown\", handler);\n return () => document.removeEventListener(\"mousedown\", handler);\n }, [onClickOutside]);\n\n return (\n <Tag\n component=\"div\"\n display=\"inline-block\"\n {...props}\n baseClass='click-outside'\n ref={mergeRef}\n >\n {children}\n </Tag>\n )\n});\n\nexport default ClickOutside;\n"],"names":[],"mappings":";;;;;;AASA;;AAEI;;;AAII;;;AAII;;;AAGJ;AAEA;;AAEJ;;AAaJ;;"}
|
package/Collaps/index.cjs
CHANGED
|
@@ -8,7 +8,7 @@ var core = require('@xanui/core');
|
|
|
8
8
|
|
|
9
9
|
const Collaps = React.forwardRef((_a, ref) => {
|
|
10
10
|
var { children, open } = _a, props = tslib.__rest(_a, ["children", "open"]);
|
|
11
|
-
let [_b] = core.useInterface("Collaps", props, {}), { ease, easing, duration, delay, onStart, onFinish,
|
|
11
|
+
let [_b] = core.useInterface("Collaps", props, {}), { ease, easing, duration, delay, onStart, onFinish, onEnter, onEntered, onExit, onExited } = _b, rest = tslib.__rest(_b, ["ease", "easing", "duration", "delay", "onStart", "onFinish", "onEnter", "onEntered", "onExit", "onExited"]);
|
|
12
12
|
open !== null && open !== void 0 ? open : (open = false);
|
|
13
13
|
easing !== null && easing !== void 0 ? easing : (easing = "standard");
|
|
14
14
|
return (jsxRuntime.jsx(core.Transition, { ease,
|
|
@@ -17,10 +17,10 @@ const Collaps = React.forwardRef((_a, ref) => {
|
|
|
17
17
|
delay,
|
|
18
18
|
onStart,
|
|
19
19
|
onFinish,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
onEnter,
|
|
21
|
+
onEntered,
|
|
22
|
+
onExit,
|
|
23
|
+
onExited, initialTransition: false, variant: "collapseVertical", open: open, children: jsxRuntime.jsx(core.Tag, Object.assign({ overflow: "hidden" }, rest, { baseClass: 'collaps', ref: ref, children: children })) }));
|
|
24
24
|
});
|
|
25
25
|
|
|
26
26
|
module.exports = Collaps;
|
package/Collaps/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../src/Collaps/index.tsx"],"sourcesContent":["\"use client\"\nimport React from 'react';\nimport { Tag, TagProps, TagComponentType, useInterface, TransitionProps, Transition } from '@xanui/core';\n\nexport type CollapsProps<T extends TagComponentType = \"div\"> = TagProps<T> & Omit<TransitionProps, \"variant\" | \"children\"> & {\n\n}\n\nconst Collaps = React.forwardRef(<T extends TagComponentType = \"div\">({ children, open, ...props }: CollapsProps<T>, ref: any) => {\n let [{\n ease,\n easing,\n duration,\n delay,\n onStart,\n onFinish,\n
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../src/Collaps/index.tsx"],"sourcesContent":["\"use client\"\nimport React from 'react';\nimport { Tag, TagProps, TagComponentType, useInterface, TransitionProps, Transition } from '@xanui/core';\n\nexport type CollapsProps<T extends TagComponentType = \"div\"> = TagProps<T> & Omit<TransitionProps, \"variant\" | \"children\"> & {\n\n}\n\nconst Collaps = React.forwardRef(<T extends TagComponentType = \"div\">({ children, open, ...props }: CollapsProps<T>, ref: any) => {\n let [{\n ease,\n easing,\n duration,\n delay,\n onStart,\n onFinish,\n onEnter,\n onEntered,\n onExit,\n onExited,\n ...rest\n }] = useInterface<any>(\"Collaps\", props, {})\n\n open ??= false\n easing ??= \"standard\"\n\n return (\n <Transition\n {...{\n ease,\n easing,\n duration,\n delay,\n onStart,\n onFinish,\n onEnter,\n onEntered,\n onExit,\n onExited\n }}\n initialTransition={false}\n variant=\"collapseVertical\"\n open={open}\n >\n <Tag\n overflow={\"hidden\"}\n {...rest}\n baseClass='collaps'\n ref={ref}\n >{children}</Tag>\n </Transition>\n )\n})\n\nexport default Collaps\n\n\n"],"names":[],"mappings":";;;;;;;;AAQA;;AACI;;;AAiBA;;;;;;;;;AAYY;AAchB;;"}
|
package/Collaps/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default from 'react';
|
|
2
2
|
import { TagComponentType, TagProps, TransitionProps } from '@xanui/core';
|
|
3
3
|
|
|
4
4
|
type CollapsProps<T extends TagComponentType = "div"> = TagProps<T> & Omit<TransitionProps, "variant" | "children"> & {};
|
|
5
|
-
declare const Collaps:
|
|
5
|
+
declare const Collaps: React__default.ForwardRefExoticComponent<Omit<CollapsProps<TagComponentType>, "ref"> & React__default.RefAttributes<unknown>>;
|
|
6
6
|
|
|
7
7
|
export { Collaps as default };
|
|
8
8
|
export type { CollapsProps };
|
package/Collaps/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { useInterface, Transition, Tag } from '@xanui/core';
|
|
|
6
6
|
|
|
7
7
|
const Collaps = React.forwardRef((_a, ref) => {
|
|
8
8
|
var { children, open } = _a, props = __rest(_a, ["children", "open"]);
|
|
9
|
-
let [_b] = useInterface("Collaps", props, {}), { ease, easing, duration, delay, onStart, onFinish,
|
|
9
|
+
let [_b] = useInterface("Collaps", props, {}), { ease, easing, duration, delay, onStart, onFinish, onEnter, onEntered, onExit, onExited } = _b, rest = __rest(_b, ["ease", "easing", "duration", "delay", "onStart", "onFinish", "onEnter", "onEntered", "onExit", "onExited"]);
|
|
10
10
|
open !== null && open !== void 0 ? open : (open = false);
|
|
11
11
|
easing !== null && easing !== void 0 ? easing : (easing = "standard");
|
|
12
12
|
return (jsx(Transition, { ease,
|
|
@@ -15,10 +15,10 @@ const Collaps = React.forwardRef((_a, ref) => {
|
|
|
15
15
|
delay,
|
|
16
16
|
onStart,
|
|
17
17
|
onFinish,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
onEnter,
|
|
19
|
+
onEntered,
|
|
20
|
+
onExit,
|
|
21
|
+
onExited, initialTransition: false, variant: "collapseVertical", open: open, children: jsx(Tag, Object.assign({ overflow: "hidden" }, rest, { baseClass: 'collaps', ref: ref, children: children })) }));
|
|
22
22
|
});
|
|
23
23
|
|
|
24
24
|
export { Collaps as default };
|
package/Collaps/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/Collaps/index.tsx"],"sourcesContent":["\"use client\"\nimport React from 'react';\nimport { Tag, TagProps, TagComponentType, useInterface, TransitionProps, Transition } from '@xanui/core';\n\nexport type CollapsProps<T extends TagComponentType = \"div\"> = TagProps<T> & Omit<TransitionProps, \"variant\" | \"children\"> & {\n\n}\n\nconst Collaps = React.forwardRef(<T extends TagComponentType = \"div\">({ children, open, ...props }: CollapsProps<T>, ref: any) => {\n let [{\n ease,\n easing,\n duration,\n delay,\n onStart,\n onFinish,\n
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/Collaps/index.tsx"],"sourcesContent":["\"use client\"\nimport React from 'react';\nimport { Tag, TagProps, TagComponentType, useInterface, TransitionProps, Transition } from '@xanui/core';\n\nexport type CollapsProps<T extends TagComponentType = \"div\"> = TagProps<T> & Omit<TransitionProps, \"variant\" | \"children\"> & {\n\n}\n\nconst Collaps = React.forwardRef(<T extends TagComponentType = \"div\">({ children, open, ...props }: CollapsProps<T>, ref: any) => {\n let [{\n ease,\n easing,\n duration,\n delay,\n onStart,\n onFinish,\n onEnter,\n onEntered,\n onExit,\n onExited,\n ...rest\n }] = useInterface<any>(\"Collaps\", props, {})\n\n open ??= false\n easing ??= \"standard\"\n\n return (\n <Transition\n {...{\n ease,\n easing,\n duration,\n delay,\n onStart,\n onFinish,\n onEnter,\n onEntered,\n onExit,\n onExited\n }}\n initialTransition={false}\n variant=\"collapseVertical\"\n open={open}\n >\n <Tag\n overflow={\"hidden\"}\n {...rest}\n baseClass='collaps'\n ref={ref}\n >{children}</Tag>\n </Transition>\n )\n})\n\nexport default Collaps\n\n\n"],"names":[],"mappings":";;;;;;AAQA;;AACI;;;AAiBA;;;;;;;;;AAYY;AAchB;;"}
|
package/Container/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default from 'react';
|
|
2
2
|
import { TagComponentType, TagProps, useBreakpointPropsType } from '@xanui/core';
|
|
3
3
|
|
|
4
4
|
type ContainerProps<T extends TagComponentType = "div"> = TagProps<T> & {
|
|
5
5
|
maxWidth?: useBreakpointPropsType<'lg' | 'md' | "sm" | 'xs'>;
|
|
6
6
|
};
|
|
7
|
-
declare const Container:
|
|
7
|
+
declare const Container: React__default.ForwardRefExoticComponent<Omit<ContainerProps<TagComponentType>, "ref"> & React__default.RefAttributes<any>>;
|
|
8
8
|
|
|
9
9
|
export { Container as default };
|
|
10
10
|
export type { ContainerProps };
|
package/DataFilter/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DataFilterProps } from './types.js';
|
|
2
2
|
export { DataFilterDate, DataFilterDateRange, DataFilterMultiSelect, DataFilterNumber, DataFilterNumberRange, DataFilterOption, DataFilterSelect, DataFilterText } from './types.js';
|
|
3
|
-
import
|
|
3
|
+
import React__default from 'react';
|
|
4
4
|
|
|
5
|
-
declare const _default:
|
|
5
|
+
declare const _default: React__default.ForwardRefExoticComponent<Omit<DataFilterProps, "ref"> & React__default.RefAttributes<HTMLDivElement>>;
|
|
6
6
|
|
|
7
7
|
export { DataFilterProps, _default as default };
|