@xanui/ui 1.1.14 → 1.1.16
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.js +18 -3
- package/Accordion/index.js.map +1 -1
- package/Accordion/index.mjs +15 -2
- package/Accordion/index.mjs.map +1 -1
- package/Alert/index.js +24 -5
- package/Alert/index.js.map +1 -1
- package/Alert/index.mjs +19 -2
- package/Alert/index.mjs.map +1 -1
- package/Avatar/index.js +13 -2
- package/Avatar/index.js.map +1 -1
- package/Avatar/index.mjs +11 -2
- package/Avatar/index.mjs.map +1 -1
- package/Badge/index.js +12 -2
- package/Badge/index.js.map +1 -1
- package/Badge/index.mjs +10 -2
- package/Badge/index.mjs.map +1 -1
- package/Box/index.js +12 -2
- package/Box/index.js.map +1 -1
- package/Box/index.mjs +10 -2
- package/Box/index.mjs.map +1 -1
- package/Button/index.js +17 -4
- package/Button/index.js.map +1 -1
- package/Button/index.mjs +13 -2
- package/Button/index.mjs.map +1 -1
- package/ButtonGroup/index.js +12 -2
- package/ButtonGroup/index.js.map +1 -1
- package/ButtonGroup/index.mjs +10 -2
- package/ButtonGroup/index.mjs.map +1 -1
- package/Calendar/index.js +35 -16
- package/Calendar/index.js.map +1 -1
- package/Calendar/index.mjs +19 -2
- package/Calendar/index.mjs.map +1 -1
- package/CalendarInput/index.js +23 -4
- package/CalendarInput/index.js.map +1 -1
- package/CalendarInput/index.mjs +19 -2
- package/CalendarInput/index.mjs.map +1 -1
- package/Checkbox/index.js +16 -2
- package/Checkbox/index.js.map +1 -1
- package/Checkbox/index.mjs +14 -2
- package/Checkbox/index.mjs.map +1 -1
- package/Chip/index.js +14 -3
- package/Chip/index.js.map +1 -1
- package/Chip/index.mjs +11 -2
- package/Chip/index.mjs.map +1 -1
- package/CircleProgress/index.js +13 -2
- package/CircleProgress/index.js.map +1 -1
- package/CircleProgress/index.mjs +11 -2
- package/CircleProgress/index.mjs.map +1 -1
- package/ClickOutside/index.js +13 -2
- package/ClickOutside/index.js.map +1 -1
- package/ClickOutside/index.mjs +11 -2
- package/ClickOutside/index.mjs.map +1 -1
- package/Collaps/index.js +12 -2
- package/Collaps/index.js.map +1 -1
- package/Collaps/index.mjs +10 -2
- package/Collaps/index.mjs.map +1 -1
- package/Container/index.js +12 -2
- package/Container/index.js.map +1 -1
- package/Container/index.mjs +10 -2
- package/Container/index.mjs.map +1 -1
- package/Datatable/FilterBox.js +22 -7
- package/Datatable/FilterBox.js.map +1 -1
- package/Datatable/FilterBox.mjs +15 -2
- package/Datatable/FilterBox.mjs.map +1 -1
- package/Datatable/Row.js +25 -7
- package/Datatable/Row.js.map +1 -1
- package/Datatable/Row.mjs +18 -2
- package/Datatable/Row.mjs.map +1 -1
- package/Datatable/SelectedBox.js +15 -4
- package/Datatable/SelectedBox.js.map +1 -1
- package/Datatable/SelectedBox.mjs +11 -2
- package/Datatable/SelectedBox.mjs.map +1 -1
- package/Datatable/Table.js +16 -4
- package/Datatable/Table.js.map +1 -1
- package/Datatable/Table.mjs +12 -2
- package/Datatable/Table.mjs.map +1 -1
- package/Datatable/TableHead.js +19 -5
- package/Datatable/TableHead.js.map +1 -1
- package/Datatable/TableHead.mjs +14 -2
- package/Datatable/TableHead.mjs.map +1 -1
- package/Datatable/index.js +20 -4
- package/Datatable/index.js.map +1 -1
- package/Datatable/index.mjs +16 -2
- package/Datatable/index.mjs.map +1 -1
- package/Divider/index.js +12 -2
- package/Divider/index.js.map +1 -1
- package/Divider/index.mjs +10 -2
- package/Divider/index.mjs.map +1 -1
- package/Drawer/index.js +16 -4
- package/Drawer/index.js.map +1 -1
- package/Drawer/index.mjs +12 -2
- package/Drawer/index.mjs.map +1 -1
- package/Form/index.js +13 -2
- package/Form/index.js.map +1 -1
- package/Form/index.mjs +11 -2
- package/Form/index.mjs.map +1 -1
- package/GridContainer/index.js +12 -2
- package/GridContainer/index.js.map +1 -1
- package/GridContainer/index.mjs +10 -2
- package/GridContainer/index.mjs.map +1 -1
- package/GridItem/index.js +12 -2
- package/GridItem/index.js.map +1 -1
- package/GridItem/index.mjs +10 -2
- package/GridItem/index.mjs.map +1 -1
- package/IconButton/index.js +22 -5
- package/IconButton/index.js.map +1 -1
- package/IconButton/index.mjs +19 -4
- package/IconButton/index.mjs.map +1 -1
- package/Image/index.js +13 -2
- package/Image/index.js.map +1 -1
- package/Image/index.mjs +11 -2
- package/Image/index.mjs.map +1 -1
- package/Input/index.js +16 -4
- package/Input/index.js.map +1 -1
- package/Input/index.mjs +13 -3
- package/Input/index.mjs.map +1 -1
- package/Label/index.js +12 -2
- package/Label/index.js.map +1 -1
- package/Label/index.mjs +10 -2
- package/Label/index.mjs.map +1 -1
- package/Layer/index.js +17 -4
- package/Layer/index.js.map +1 -1
- package/Layer/index.mjs +13 -2
- package/Layer/index.mjs.map +1 -1
- package/LineProgress/index.js +13 -2
- package/LineProgress/index.js.map +1 -1
- package/LineProgress/index.mjs +11 -2
- package/LineProgress/index.mjs.map +1 -1
- package/List/index.js +12 -2
- package/List/index.js.map +1 -1
- package/List/index.mjs +10 -2
- package/List/index.mjs.map +1 -1
- package/ListItem/index.js +14 -3
- package/ListItem/index.js.map +1 -1
- package/ListItem/index.mjs +11 -2
- package/ListItem/index.mjs.map +1 -1
- package/LoadingBox/index.js +14 -3
- package/LoadingBox/index.js.map +1 -1
- package/LoadingBox/index.mjs +11 -2
- package/LoadingBox/index.mjs.map +1 -1
- package/Menu/index.js +16 -3
- package/Menu/index.js.map +1 -1
- package/Menu/index.mjs +13 -2
- package/Menu/index.mjs.map +1 -1
- package/Modal/index.js +15 -3
- package/Modal/index.js.map +1 -1
- package/Modal/index.mjs +12 -2
- package/Modal/index.mjs.map +1 -1
- package/NoSSR/index.js +10 -2
- package/NoSSR/index.js.map +1 -1
- package/NoSSR/index.mjs +8 -2
- package/NoSSR/index.mjs.map +1 -1
- package/Option/index.js +13 -3
- package/Option/index.js.map +1 -1
- package/Option/index.mjs +10 -2
- package/Option/index.mjs.map +1 -1
- package/Paper/index.js +12 -2
- package/Paper/index.js.map +1 -1
- package/Paper/index.mjs +10 -2
- package/Paper/index.mjs.map +1 -1
- package/Portal/index.js +13 -2
- package/Portal/index.js.map +1 -1
- package/Portal/index.mjs +11 -2
- package/Portal/index.mjs.map +1 -1
- package/Radio/index.js +15 -3
- package/Radio/index.js.map +1 -1
- package/Radio/index.mjs +12 -2
- package/Radio/index.mjs.map +1 -1
- package/Scrollbar/index.js +13 -2
- package/Scrollbar/index.js.map +1 -1
- package/Scrollbar/index.mjs +11 -2
- package/Scrollbar/index.mjs.map +1 -1
- package/Select/index.js +22 -5
- package/Select/index.js.map +1 -1
- package/Select/index.mjs +17 -2
- package/Select/index.mjs.map +1 -1
- package/Stack/index.js +12 -2
- package/Stack/index.js.map +1 -1
- package/Stack/index.mjs +10 -2
- package/Stack/index.mjs.map +1 -1
- package/Switch/index.js +13 -2
- package/Switch/index.js.map +1 -1
- package/Switch/index.mjs +11 -2
- package/Switch/index.mjs.map +1 -1
- package/Tab/index.js +15 -3
- package/Tab/index.js.map +1 -1
- package/Tab/index.mjs +12 -2
- package/Tab/index.mjs.map +1 -1
- package/Table/index.js +14 -3
- package/Table/index.js.map +1 -1
- package/Table/index.mjs +11 -2
- package/Table/index.mjs.map +1 -1
- package/TableBody/index.js +12 -2
- package/TableBody/index.js.map +1 -1
- package/TableBody/index.mjs +10 -2
- package/TableBody/index.mjs.map +1 -1
- package/TableCell/index.js +12 -2
- package/TableCell/index.js.map +1 -1
- package/TableCell/index.mjs +10 -2
- package/TableCell/index.mjs.map +1 -1
- package/TableFooter/index.js +12 -2
- package/TableFooter/index.js.map +1 -1
- package/TableFooter/index.mjs +10 -2
- package/TableFooter/index.mjs.map +1 -1
- package/TableHead/index.js +12 -2
- package/TableHead/index.js.map +1 -1
- package/TableHead/index.mjs +10 -2
- package/TableHead/index.mjs.map +1 -1
- package/TablePagination/index.d.ts +8 -7
- package/TablePagination/index.js +23 -6
- package/TablePagination/index.js.map +1 -1
- package/TablePagination/index.mjs +17 -2
- package/TablePagination/index.mjs.map +1 -1
- package/TableRow/index.js +12 -2
- package/TableRow/index.js.map +1 -1
- package/TableRow/index.mjs +10 -2
- package/TableRow/index.mjs.map +1 -1
- package/Tabs/index.js +26 -13
- package/Tabs/index.js.map +1 -1
- package/Tabs/index.mjs +24 -13
- package/Tabs/index.mjs.map +1 -1
- package/Text/index.js +12 -2
- package/Text/index.js.map +1 -1
- package/Text/index.mjs +10 -2
- package/Text/index.mjs.map +1 -1
- package/Toast/index.js +18 -4
- package/Toast/index.js.map +1 -1
- package/Toast/index.mjs +14 -2
- package/Toast/index.mjs.map +1 -1
- package/Tooltip/index.js +14 -3
- package/Tooltip/index.js.map +1 -1
- package/Tooltip/index.mjs +11 -2
- package/Tooltip/index.mjs.map +1 -1
- package/ViewBox/index.js +14 -3
- package/ViewBox/index.js.map +1 -1
- package/ViewBox/index.mjs +11 -2
- package/ViewBox/index.mjs.map +1 -1
- package/index.js +116 -1
- package/index.js.map +1 -1
- package/index.mjs +56 -1
- package/index.mjs.map +1 -1
- package/package.json +3 -12
- package/readme.md +104 -104
- package/useAlert/index.js +19 -5
- package/useAlert/index.js.map +1 -1
- package/useAlert/index.mjs +14 -2
- package/useAlert/index.mjs.map +1 -1
- package/useBlurCss/index.js +10 -2
- package/useBlurCss/index.js.map +1 -1
- package/useBlurCss/index.mjs +8 -2
- package/useBlurCss/index.mjs.map +1 -1
- package/useCorner/index.js +7 -2
- package/useCorner/index.js.map +1 -1
- package/useCorner/index.mjs +4 -1
- package/useCorner/index.mjs.map +1 -1
- package/useLayer/index.js +14 -3
- package/useLayer/index.js.map +1 -1
- package/useLayer/index.mjs +11 -2
- package/useLayer/index.mjs.map +1 -1
- package/useModal/index.js +14 -3
- package/useModal/index.js.map +1 -1
- package/useModal/index.mjs +11 -2
- package/useModal/index.mjs.map +1 -1
package/Input/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../src/Input/index.tsx"],"sourcesContent":["\nimport React, { MutableRefObject, ReactElement, useEffect, useMemo, useRef, useState } from 'react';\nimport { Tag, TagProps, TagComponentType, UseColorTemplateColor, useBreakpointPropsType, useInterface, useBreakpointProps } from '@xanui/core';\nimport Text from '../Text';\n\n\n\nexport type InputProps<T extends TagComponentType = \"input\"> = Omit<TagProps<T>, \"size\" | \"color\"> & {\n startIcon?: useBreakpointPropsType<ReactElement>;\n endIcon?: useBreakpointPropsType<ReactElement>;\n iconPlacement?: useBreakpointPropsType<\"start\" | \"center\" | \"end\">;\n focused?: boolean;\n color?: useBreakpointPropsType<Omit<UseColorTemplateColor, \"default\">>;\n containerRef?: MutableRefObject<HTMLDivElement | undefined>;\n variant?: useBreakpointPropsType<\"fill\" | \"outline\" | \"text\">;\n error?: boolean;\n helperText?: useBreakpointPropsType<string>;\n multiline?: boolean;\n size?: useBreakpointPropsType<\"small\" | \"medium\" | \"large\">;\n rows?: useBreakpointPropsType<number>;\n minRows?: useBreakpointPropsType<number>;\n maxRows?: useBreakpointPropsType<number>;\n slotProps?: {\n container?: Omit<TagProps<\"div\">, \"children\">\n }\n}\n\nconst Input = React.forwardRef(<T extends TagComponentType = \"input\">({ value, ...props }: InputProps<T>, ref?: React.Ref<any>) => {\n let [{\n startIcon,\n endIcon,\n iconPlacement,\n onFocus,\n color,\n onBlur,\n focused,\n containerRef,\n disabled,\n variant,\n error,\n helperText,\n multiline,\n size,\n rows,\n minRows,\n maxRows,\n slotProps,\n ...rest\n }, theme] = useInterface<any>(\"Input\", props, {})\n\n const _p: any = {}\n if (startIcon) _p.startIcon = startIcon\n if (endIcon) _p.endIcon = endIcon\n if (iconPlacement) _p.iconPlacement = iconPlacement\n if (color) _p.color = color\n if (variant) _p.variant = variant\n if (helperText) _p.helperText = helperText\n if (size) _p.size = size\n if (rows) _p.rows = rows\n if (minRows) _p.minRows = minRows\n if (maxRows) _p.maxRows = maxRows\n const p: any = useBreakpointProps(_p)\n startIcon = p.startIcon\n endIcon = p.endIcon\n iconPlacement = p.iconPlacement\n color = p.color ?? \"brand\"\n variant = p.variant ?? \"fill\"\n helperText = p.helperText\n size = p.size ?? 'medium'\n rows = p.rows\n minRows = p.minRows\n maxRows = p.maxRows\n\n ref ??= useRef(null);\n iconPlacement ??= multiline ? \"end\" : \"center\"\n if (!value) iconPlacement = 'center'\n\n const [_focused, setFocused] = useState(false)\n const conRef: any = useRef(null)\n let _focus = focused || _focused\n\n useEffect(() => {\n if (containerRef) {\n (containerRef as any).current = conRef?.current\n }\n }, [containerRef])\n\n let _rows = useMemo(() => {\n if (rows) return rows\n if (value && multiline) {\n let lines = (value as string).split(`\\n`).length\n if (minRows && minRows > lines) {\n return minRows\n } else if (maxRows && maxRows < lines) {\n return maxRows\n } else {\n return lines\n }\n }\n }, [value]) || 1\n\n const sizes: any = {\n small: {\n height: 40,\n gap: .5,\n fontSize: 'button',\n },\n medium: {\n height: 48,\n gap: 1,\n fontSize: \"text\"\n },\n large: {\n height: 52,\n gap: 1,\n fontSize: 'big'\n }\n }\n\n const _size = sizes[size]\n let borderColor = _focus ? color : (variant === \"fill\" ? \"transparent\" : \"divider\")\n borderColor = error ? \"danger.primary\" : borderColor\n let multiprops: any = {}\n if (multiline) {\n multiprops = {\n rows: _rows,\n sx: {\n resize: \"none\"\n }\n }\n }\n\n useEffect(() => {\n if ((ref as any).current) {\n (ref as any).current.style.height = \"auto\";\n (ref as any).current.style.height = `${(ref as any).current.scrollHeight}px`;\n }\n }, [value]);\n\n return (\n <Tag\n baseClass={`input${_focus ? \" input-focused\" : \"\"}`}\n >\n <Tag\n {...slotProps?.container}\n sxr={{\n display: \"flex\",\n flexDirection: \"row\",\n alignItems: iconPlacement === 'center' ? iconPlacement : `flex-${iconPlacement}`,\n flexWrap: \"nowrap\",\n minWidth: 150,\n transitionProperty: \"border, box-shadow, background\",\n bgcolor: error ? \"danger.soft.primary\" : variant === \"fill\" ? \"background.secondary\" : \"background.primary\",\n border: variant === \"text\" ? 0 : \"1px solid\",\n borderColor: borderColor,\n borderRadius: 1,\n px: 1,\n py: .5,\n }}\n baseClass='input-container'\n disabled={disabled || false}\n ref={conRef}\n {..._size}\n height={multiline ? \"auto\" : _size.height}\n minHeight={_size.height}\n >\n {startIcon && <Tag\n flex={\"0 0 auto\"}\n sxr={{\n height: \"100%\",\n alignItems: 'center',\n justifyContent: \"center\",\n display: \"flex\",\n color: error ? \"danger.primary\" : \"text.secondary\",\n }}\n baseClass=\"input-start-icon\"\n >{startIcon}</Tag>}\n <Tag\n flex={1}\n sxr={{\n display: \"flex\",\n alignItems: \"center\",\n flex: 1,\n minHeight: _size.height,\n \"& textarea\": {\n resize: \"none\"\n },\n \"& input:-webkit-autofill,& input:-webkit-autofill:hover, & input:-webkit-autofill:focus,& input:-webkit-autofill:active\": {\n \"-webkit-text-fill-color\": \"text.primary\",\n \"box-shadow\": `0 0 0px 1000px ${variant === \"fill\" ? theme.colors.background.secondary : theme.colors.background.primary} inset`,\n transition: \"background-color 5000s ease-in-out 0s\"\n } as any\n }}\n >\n <Tag\n component={multiline ? 'textarea' : 'input'}\n {...multiprops}\n {...rest}\n sxr={{\n border: 0,\n outline: 0,\n bgcolor: \"transparent\",\n color: error ? \"danger.primary\" : \"text.primary\",\n fontSize: _size.fontSize,\n height: multiline ? \"auto\" : _size.height + \"px!important\",\n width: \"100%\",\n maxHeight: 200,\n }}\n value={value}\n baseClass='input-box'\n ref={ref}\n onFocus={(e: any) => {\n focused ?? setFocused(true)\n onFocus && onFocus(e)\n }}\n onBlur={(e: any) => {\n focused ?? setFocused(false)\n onBlur && onBlur(e)\n }}\n />\n </Tag>\n {endIcon && <Tag\n flex={\"0 0 auto\"}\n sxr={{\n height: \"100%\",\n alignItems: 'center',\n justifyContent: \"center\",\n display: 'flex',\n color: error ? \"danger.primary\" : \"text.secondary\",\n }}\n baseClass=\"input-end-icon\"\n >{endIcon}</Tag>}\n </Tag>\n {helperText && <Text\n pl={.5}\n className=\"input-helper-text\"\n fontSize=\"small\"\n color={error ?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AA,CAAC,EAAA,CAAA,CACH,EAAA,CACA,EACL,OAAO,IAAIA,GAAA,CAAC,GAAG,EAAA,EACZ,IAAI,EAAE,UAAU,EAChB,GAAG,EAAE;AACD,4BAAA,MAAM,EAAE,MAAM;AACd,4BAAA,UAAU,EAAE,QAAQ;AACpB,4BAAA,cAAc,EAAE,QAAQ;AACxB,4BAAA,OAAO,EAAE,MAAM;4BACf,KAAK,EAAE,KAAK,GAAG,gBAAgB,GAAG,gBAAgB;AACrD,yBAAA,EACD,SAAS,EAAC,gBAAgB,YAC5B,OAAO,EAAA,CAAO,KACd,EACL,UAAU,IAAIA,GAAA,CAAC,IAAI,EAAA,EAChB,EAAE,EAAE,EAAE,EACN,SAAS,EAAC,mBAAmB,EAC7B,QAAQ,EAAC,OAAO,EAChB,KAAK,EAAE,KAAK,GAAG,gBAAgB,GAAG,cAAc,EAAA,QAAA,EAClD,UAAU,EAAA,CAAQ,CAAA,EAAA,CAClB;AAEd,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../src/Input/index.tsx"],"sourcesContent":["\"use client\";\r\nimport React, { MutableRefObject, ReactElement, useEffect, useMemo, useRef, useState } from 'react';\r\nimport { Tag, TagProps, TagComponentType, UseColorTemplateColor, useBreakpointPropsType, useInterface, useBreakpointProps } from '@xanui/core';\r\nimport Text from '../Text';\r\n\r\nexport type InputProps<T extends TagComponentType = \"input\"> = Omit<TagProps<T>, \"size\" | \"color\"> & {\r\n startIcon?: useBreakpointPropsType<ReactElement>;\r\n endIcon?: useBreakpointPropsType<ReactElement>;\r\n iconPlacement?: useBreakpointPropsType<\"start\" | \"center\" | \"end\">;\r\n focused?: boolean;\r\n color?: useBreakpointPropsType<Omit<UseColorTemplateColor, \"default\">>;\r\n containerRef?: MutableRefObject<HTMLDivElement | undefined>;\r\n variant?: useBreakpointPropsType<\"fill\" | \"outline\" | \"text\">;\r\n error?: boolean;\r\n helperText?: useBreakpointPropsType<string>;\r\n multiline?: boolean;\r\n size?: useBreakpointPropsType<\"small\" | \"medium\" | \"large\">;\r\n rows?: useBreakpointPropsType<number>;\r\n minRows?: useBreakpointPropsType<number>;\r\n maxRows?: useBreakpointPropsType<number>;\r\n slotProps?: {\r\n container?: Omit<TagProps<\"div\">, \"children\">\r\n }\r\n}\r\n\r\nconst Input = React.forwardRef(<T extends TagComponentType = \"input\">({ value, ...props }: InputProps<T>, ref?: React.Ref<any>) => {\r\n let [{\r\n startIcon,\r\n endIcon,\r\n iconPlacement,\r\n onFocus,\r\n color,\r\n onBlur,\r\n focused,\r\n containerRef,\r\n disabled,\r\n variant,\r\n error,\r\n helperText,\r\n multiline,\r\n size,\r\n rows,\r\n minRows,\r\n maxRows,\r\n slotProps,\r\n ...rest\r\n }, theme] = useInterface<any>(\"Input\", props, {})\r\n\r\n const _p: any = {}\r\n if (startIcon) _p.startIcon = startIcon\r\n if (endIcon) _p.endIcon = endIcon\r\n if (iconPlacement) _p.iconPlacement = iconPlacement\r\n if (color) _p.color = color\r\n if (variant) _p.variant = variant\r\n if (helperText) _p.helperText = helperText\r\n if (size) _p.size = size\r\n if (rows) _p.rows = rows\r\n if (minRows) _p.minRows = minRows\r\n if (maxRows) _p.maxRows = maxRows\r\n const p: any = useBreakpointProps(_p)\r\n startIcon = p.startIcon\r\n endIcon = p.endIcon\r\n iconPlacement = p.iconPlacement\r\n color = p.color ?? \"brand\"\r\n variant = p.variant ?? \"fill\"\r\n helperText = p.helperText\r\n size = p.size ?? 'medium'\r\n rows = p.rows\r\n minRows = p.minRows\r\n maxRows = p.maxRows\r\n\r\n ref ??= useRef(null);\r\n iconPlacement ??= multiline ? \"end\" : \"center\"\r\n if (!value) iconPlacement = 'center'\r\n\r\n const [_focused, setFocused] = useState(false)\r\n const conRef: any = useRef(null)\r\n let _focus = focused || _focused\r\n\r\n useEffect(() => {\r\n if (containerRef) {\r\n (containerRef as any).current = conRef?.current\r\n }\r\n }, [containerRef])\r\n\r\n let _rows = useMemo(() => {\r\n if (rows) return rows\r\n if (value && multiline) {\r\n let lines = (value as string).split(`\\n`).length\r\n if (minRows && minRows > lines) {\r\n return minRows\r\n } else if (maxRows && maxRows < lines) {\r\n return maxRows\r\n } else {\r\n return lines\r\n }\r\n }\r\n }, [value]) || 1\r\n\r\n const sizes: any = {\r\n small: {\r\n height: 40,\r\n gap: .5,\r\n fontSize: 'button',\r\n },\r\n medium: {\r\n height: 48,\r\n gap: 1,\r\n fontSize: \"text\"\r\n },\r\n large: {\r\n height: 52,\r\n gap: 1,\r\n fontSize: 'big'\r\n }\r\n }\r\n\r\n const _size = sizes[size]\r\n let borderColor = _focus ? color : (variant === \"fill\" ? \"transparent\" : \"divider\")\r\n borderColor = error ? \"danger.primary\" : borderColor\r\n let multiprops: any = {}\r\n if (multiline) {\r\n multiprops = {\r\n rows: _rows,\r\n sx: {\r\n resize: \"none\"\r\n }\r\n }\r\n }\r\n\r\n useEffect(() => {\r\n if ((ref as any).current) {\r\n (ref as any).current.style.height = \"auto\";\r\n (ref as any).current.style.height = `${(ref as any).current.scrollHeight}px`;\r\n }\r\n }, [value]);\r\n\r\n return (\r\n <Tag\r\n baseClass={`input${_focus ? \" input-focused\" : \"\"}`}\r\n >\r\n <Tag\r\n {...slotProps?.container}\r\n sxr={{\r\n display: \"flex\",\r\n flexDirection: \"row\",\r\n alignItems: iconPlacement === 'center' ? iconPlacement : `flex-${iconPlacement}`,\r\n flexWrap: \"nowrap\",\r\n // minWidth: 100,\r\n transitionProperty: \"border, box-shadow, background\",\r\n bgcolor: error ? \"danger.soft.primary\" : variant === \"fill\" ? \"background.secondary\" : \"background.primary\",\r\n border: variant === \"text\" ? 0 : \"1px solid\",\r\n borderColor: borderColor,\r\n borderRadius: 1,\r\n px: 1,\r\n py: .5,\r\n }}\r\n baseClass='input-container'\r\n disabled={disabled || false}\r\n ref={conRef}\r\n {..._size}\r\n height={multiline ? \"auto\" : _size.height}\r\n minHeight={_size.height}\r\n >\r\n {startIcon && <Tag\r\n flex={\"0 0 auto\"}\r\n sxr={{\r\n height: \"100%\",\r\n alignItems: 'center',\r\n justifyContent: \"center\",\r\n display: \"flex\",\r\n color: error ? \"danger.primary\" : \"text.secondary\",\r\n }}\r\n baseClass=\"input-start-icon\"\r\n >{startIcon}</Tag>}\r\n <Tag\r\n flex={1}\r\n sxr={{\r\n display: \"flex\",\r\n alignItems: \"center\",\r\n flex: 1,\r\n minHeight: _size.height,\r\n \"& textarea\": {\r\n resize: \"none\"\r\n },\r\n \"& input:-webkit-autofill,& input:-webkit-autofill:hover, & input:-webkit-autofill:focus,& input:-webkit-autofill:active\": {\r\n \"-webkit-text-fill-color\": \"text.primary\",\r\n \"box-shadow\": `0 0 0px 1000px ${variant === \"fill\" ? theme.colors.background.secondary : theme.colors.background.primary} inset`,\r\n transition: \"background-color 5000s ease-in-out 0s\"\r\n } as any\r\n }}\r\n >\r\n <Tag\r\n component={multiline ? 'textarea' : 'input'}\r\n {...multiprops}\r\n {...rest}\r\n sxr={{\r\n border: 0,\r\n outline: 0,\r\n bgcolor: \"transparent\",\r\n color: error ? \"danger.primary\" : \"text.primary\",\r\n fontSize: _size.fontSize,\r\n height: multiline ? \"auto\" : _size.height + \"px!important\",\r\n width: \"100%\",\r\n maxHeight: 200,\r\n }}\r\n value={value}\r\n baseClass='input-box'\r\n ref={ref}\r\n onFocus={(e: any) => {\r\n focused ?? setFocused(true)\r\n onFocus && onFocus(e)\r\n }}\r\n onBlur={(e: any) => {\r\n focused ?? setFocused(false)\r\n onBlur && onBlur(e)\r\n }}\r\n />\r\n </Tag>\r\n {endIcon && <Tag\r\n flex={\"0 0 auto\"}\r\n sxr={{\r\n height: \"100%\",\r\n alignItems: 'center',\r\n justifyContent: \"center\",\r\n display: 'flex',\r\n color: error ? \"danger.primary\" : \"text.secondary\",\r\n }}\r\n baseClass=\"input-end-icon\"\r\n >{endIcon}</Tag>}\r\n </Tag>\r\n {helperText && <Text\r\n pl={.5}\r\n className=\"input-helper-text\"\r\n fontSize=\"small\"\r\n color={error ? \"danger.primary\" : \"text.primary\"}\r\n >{helperText}</Text>}\r\n </Tag>\r\n )\r\n})\r\n\r\nexport default Input\r\n"],"names":[],"mappings":";;;;;;;AAyBA;;AAAsE;;;AAwBlE;AAAe;AACf;AAAa;AACb;AAAmB;AACnB;AAAW;AACX;AAAa;AACb;AAAgB;AAChB;AAAU;AACV;AAAU;AACV;AAAa;AACb;AAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;;;AAGA;AACA;;;;;AAMA;AAEA;AACI;AAAU;AACV;;AAEI;AACI;;AACG;AACH;;;AAEA;;;AAGZ;AAEA;AACI;AACI;AACA;AACA;AACH;AACD;AACI;AACA;AACA;AACH;AACD;AACI;AACA;AACA;AACH;;AAGL;;;;;AAKI;AACI;AACA;AACI;AACH;;;;AAKL;;AAEK;;AAET;AAEA;AAOgB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAYI;AACA;AACA;AACA;;AAEH;AAMG;AACA;AACA;;AAEA;AACI;AACH;AACD;AACI;;AAEA;AACI;;AAQJ;AACA;AACA;;;AAGA;AACA;AACA;AACH;;AAMG;AACJ;;AAGI;AACJ;AAMA;AACA;AACA;AACA;;AAEH;AAYrB;;"}
|
package/Label/index.js
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
'use strict';
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var tslib = require('tslib');
|
|
4
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
+
var React = require('react');
|
|
6
|
+
var core = require('@xanui/core');
|
|
7
|
+
|
|
8
|
+
const Label = React.forwardRef((_a, ref) => {
|
|
2
9
|
var { children } = _a, rest = tslib.__rest(_a, ["children"]);
|
|
3
10
|
return jsxRuntime.jsx(core.Tag, Object.assign({ component: 'label' }, rest, { sxr: {
|
|
4
11
|
display: "inline-flex",
|
|
@@ -11,4 +18,7 @@
|
|
|
11
18
|
cursor: "pointer",
|
|
12
19
|
fontWeight: "500",
|
|
13
20
|
}, baseClass: 'label', ref: ref, children: children }));
|
|
14
|
-
});
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
module.exports = Label;
|
|
24
|
+
//# sourceMappingURL=index.js.map
|
package/Label/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/Label/index.tsx"],"sourcesContent":["\nimport React from 'react';\nimport { Tag, TagProps, TagComponentType } from '@xanui/core';\n\nexport type LabelProps<T extends TagComponentType = \"label\"> = TagProps<T>\n\nconst Label = React.forwardRef(<T extends TagComponentType = \"label\">({ children, ...rest }: LabelProps<T>, ref: React.Ref<any>) => {\n return <Tag\n component='label'\n {...rest}\n sxr={{\n display: \"inline-flex\",\n alignItems: \"center\",\n verticalAlign: \"middle\",\n fontSize: \"text\",\n gap: .4,\n color: \"text.primary\",\n userSelect: \"none\",\n cursor: \"pointer\",\n fontWeight: \"500\",\n }}\n baseClass='label'\n ref={ref}\n >{children}</Tag>\n})\n\nexport default Label"],"names":["__rest","_jsx","Tag"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/Label/index.tsx"],"sourcesContent":["\r\nimport React from 'react';\r\nimport { Tag, TagProps, TagComponentType } from '@xanui/core';\r\n\r\nexport type LabelProps<T extends TagComponentType = \"label\"> = TagProps<T>\r\n\r\nconst Label = React.forwardRef(<T extends TagComponentType = \"label\">({ children, ...rest }: LabelProps<T>, ref: React.Ref<any>) => {\r\n return <Tag\r\n component='label'\r\n {...rest}\r\n sxr={{\r\n display: \"inline-flex\",\r\n alignItems: \"center\",\r\n verticalAlign: \"middle\",\r\n fontSize: \"text\",\r\n gap: .4,\r\n color: \"text.primary\",\r\n userSelect: \"none\",\r\n cursor: \"pointer\",\r\n fontWeight: \"500\",\r\n }}\r\n baseClass='label'\r\n ref={ref}\r\n >{children}</Tag>\r\n})\r\n\r\nexport default Label"],"names":["__rest","_jsx","Tag"],"mappings":";;;;;;;AAMA,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CAAC,CAAuC,EAAoC,EAAE,GAAmB,KAAI;AAA7D,IAAA,IAAA,EAAE,QAAQ,EAAA,GAAA,EAA0B,EAArB,IAAI,GAAAA,YAAA,CAAA,EAAA,EAAnB,YAAqB,CAAF;IACrF,OAAOC,cAAA,CAACC,QAAG,EAAA,MAAA,CAAA,MAAA,CAAA,EACP,SAAS,EAAC,OAAO,EAAA,EACb,IAAI,EAAA,EACR,GAAG,EAAE;AACD,YAAA,OAAO,EAAE,aAAa;AACtB,YAAA,UAAU,EAAE,QAAQ;AACpB,YAAA,aAAa,EAAE,QAAQ;AACvB,YAAA,QAAQ,EAAE,MAAM;AAChB,YAAA,GAAG,EAAE,EAAE;AACP,YAAA,KAAK,EAAE,cAAc;AACrB,YAAA,UAAU,EAAE,MAAM;AAClB,YAAA,MAAM,EAAE,SAAS;AACjB,YAAA,UAAU,EAAE,KAAK;SACpB,EACD,SAAS,EAAC,OAAO,EACjB,GAAG,EAAE,GAAG,EAAA,QAAA,EACV,QAAQ,EAAA,CAAA,CAAO;AACrB,CAAC;;;;"}
|
package/Label/index.mjs
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import {__rest
|
|
1
|
+
import { __rest } from 'tslib';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { Tag } from '@xanui/core';
|
|
5
|
+
|
|
6
|
+
const Label = React.forwardRef((_a, ref) => {
|
|
2
7
|
var { children } = _a, rest = __rest(_a, ["children"]);
|
|
3
8
|
return jsx(Tag, Object.assign({ component: 'label' }, rest, { sxr: {
|
|
4
9
|
display: "inline-flex",
|
|
@@ -11,4 +16,7 @@ import {__rest}from'tslib';import {jsx}from'react/jsx-runtime';import React from
|
|
|
11
16
|
cursor: "pointer",
|
|
12
17
|
fontWeight: "500",
|
|
13
18
|
}, baseClass: 'label', ref: ref, children: children }));
|
|
14
|
-
});
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
export { Label as default };
|
|
22
|
+
//# sourceMappingURL=index.mjs.map
|
package/Label/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../src/Label/index.tsx"],"sourcesContent":["\nimport React from 'react';\nimport { Tag, TagProps, TagComponentType } from '@xanui/core';\n\nexport type LabelProps<T extends TagComponentType = \"label\"> = TagProps<T>\n\nconst Label = React.forwardRef(<T extends TagComponentType = \"label\">({ children, ...rest }: LabelProps<T>, ref: React.Ref<any>) => {\n return <Tag\n component='label'\n {...rest}\n sxr={{\n display: \"inline-flex\",\n alignItems: \"center\",\n verticalAlign: \"middle\",\n fontSize: \"text\",\n gap: .4,\n color: \"text.primary\",\n userSelect: \"none\",\n cursor: \"pointer\",\n fontWeight: \"500\",\n }}\n baseClass='label'\n ref={ref}\n >{children}</Tag>\n})\n\nexport default Label"],"names":["_jsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../src/Label/index.tsx"],"sourcesContent":["\r\nimport React from 'react';\r\nimport { Tag, TagProps, TagComponentType } from '@xanui/core';\r\n\r\nexport type LabelProps<T extends TagComponentType = \"label\"> = TagProps<T>\r\n\r\nconst Label = React.forwardRef(<T extends TagComponentType = \"label\">({ children, ...rest }: LabelProps<T>, ref: React.Ref<any>) => {\r\n return <Tag\r\n component='label'\r\n {...rest}\r\n sxr={{\r\n display: \"inline-flex\",\r\n alignItems: \"center\",\r\n verticalAlign: \"middle\",\r\n fontSize: \"text\",\r\n gap: .4,\r\n color: \"text.primary\",\r\n userSelect: \"none\",\r\n cursor: \"pointer\",\r\n fontWeight: \"500\",\r\n }}\r\n baseClass='label'\r\n ref={ref}\r\n >{children}</Tag>\r\n})\r\n\r\nexport default Label"],"names":["_jsx"],"mappings":";;;;;AAMA,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CAAC,CAAuC,EAAoC,EAAE,GAAmB,KAAI;AAA7D,IAAA,IAAA,EAAE,QAAQ,EAAA,GAAA,EAA0B,EAArB,IAAI,GAAA,MAAA,CAAA,EAAA,EAAnB,YAAqB,CAAF;IACrF,OAAOA,GAAA,CAAC,GAAG,EAAA,MAAA,CAAA,MAAA,CAAA,EACP,SAAS,EAAC,OAAO,EAAA,EACb,IAAI,EAAA,EACR,GAAG,EAAE;AACD,YAAA,OAAO,EAAE,aAAa;AACtB,YAAA,UAAU,EAAE,QAAQ;AACpB,YAAA,aAAa,EAAE,QAAQ;AACvB,YAAA,QAAQ,EAAE,MAAM;AAChB,YAAA,GAAG,EAAE,EAAE;AACP,YAAA,KAAK,EAAE,cAAc;AACrB,YAAA,UAAU,EAAE,MAAM;AAClB,YAAA,MAAM,EAAE,SAAS;AACjB,YAAA,UAAU,EAAE,KAAK;SACpB,EACD,SAAS,EAAC,OAAO,EACjB,GAAG,EAAE,GAAG,EAAA,QAAA,EACV,QAAQ,EAAA,CAAA,CAAO;AACrB,CAAC;;;;"}
|
package/Layer/index.js
CHANGED
|
@@ -1,4 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var tslib = require('tslib');
|
|
5
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var core = require('@xanui/core');
|
|
8
|
+
var index = require('../useBlurCss/index.js');
|
|
9
|
+
var index$1 = require('../ClickOutside/index.js');
|
|
10
|
+
|
|
11
|
+
const Layer = (_a) => {
|
|
2
12
|
var _b, _c, _d;
|
|
3
13
|
var { children, open } = _a, props = tslib.__rest(_a, ["children", "open"]);
|
|
4
14
|
let [{ onClickOutside, placement, transition, zIndex, blur, blurMode, onOpen, onOpened, onClose, onClosed, slotProps }] = core.useInterface("Layer", props, {});
|
|
@@ -12,7 +22,7 @@
|
|
|
12
22
|
blurMode = p.blurMode;
|
|
13
23
|
const [closed, setClosed] = React.useState(!open);
|
|
14
24
|
placement = placement || "bottom-left";
|
|
15
|
-
const blurCss = blur ? index
|
|
25
|
+
const blurCss = blur ? index(blur, blurMode) : {};
|
|
16
26
|
React.useEffect(() => {
|
|
17
27
|
if (closed && open) {
|
|
18
28
|
setClosed(false);
|
|
@@ -26,7 +36,7 @@
|
|
|
26
36
|
setClosed(true);
|
|
27
37
|
onClosed && onClosed();
|
|
28
38
|
}, children: children }));
|
|
29
|
-
return (jsxRuntime.jsx(core.Transition, { duration: duration, delay: delay, easing: "smooth", variant: "fade", open: open, children: jsxRuntime.jsx(core.Tag, Object.assign({ baseClass: "layer" }, slotProps === null || slotProps === void 0 ? void 0 : slotProps.root, { sxr: Object.assign(Object.assign(Object.assign({}, (_d = slotProps === null || slotProps === void 0 ? void 0 : slotProps.root) === null || _d === void 0 ? void 0 : _d.sx), { position: "fixed", zIndex: 1500 + (zIndex || 0), top: 0, left: 0, bottom: 0, right: 0, width: "100%", height: "100%" }), blurCss), children: onClickOutside ? jsxRuntime.jsx(index$1
|
|
39
|
+
return (jsxRuntime.jsx(core.Transition, { duration: duration, delay: delay, easing: "smooth", variant: "fade", open: open, children: jsxRuntime.jsx(core.Tag, Object.assign({ baseClass: "layer" }, slotProps === null || slotProps === void 0 ? void 0 : slotProps.root, { sxr: Object.assign(Object.assign(Object.assign({}, (_d = slotProps === null || slotProps === void 0 ? void 0 : slotProps.root) === null || _d === void 0 ? void 0 : _d.sx), { position: "fixed", zIndex: 1500 + (zIndex || 0), top: 0, left: 0, bottom: 0, right: 0, width: "100%", height: "100%" }), blurCss), children: onClickOutside ? jsxRuntime.jsx(index$1, Object.assign({}, slotProps === null || slotProps === void 0 ? void 0 : slotProps.clickOutside, { onClickOutside: onClickOutside || (() => { }), children: content })) : content })) }));
|
|
30
40
|
};
|
|
31
41
|
Layer.open = (children, props) => {
|
|
32
42
|
const l = core.Renderar.render(Layer, Object.assign(Object.assign({ open: true }, props), { children, onClosed: () => {
|
|
@@ -46,4 +56,7 @@ Layer.open = (children, props) => {
|
|
|
46
56
|
};
|
|
47
57
|
Layer.close = () => {
|
|
48
58
|
core.Renderar.unrender(Layer);
|
|
49
|
-
};
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
module.exports = Layer;
|
|
62
|
+
//# sourceMappingURL=index.js.map
|
package/Layer/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/Layer/index.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/Layer/index.tsx"],"sourcesContent":["\"use client\";\r\nimport { ReactNode, useEffect, useState } from 'react'\r\nimport { Tag, TagProps, useBreakpointProps, useBreakpointPropsType, useInterface, TransitionProps, Transition } from \"@xanui/core\"\r\nimport useBlurCss from '../useBlurCss';\r\nimport { Renderar } from \"@xanui/core\";\r\nimport ClickOutside, { ClickOutsideProps } from '../ClickOutside';\r\n\r\nexport type LayerProps = {\r\n open: boolean;\r\n children: ReactNode;\r\n transition?: TransitionProps['variant'];\r\n zIndex?: number;\r\n blur?: useBreakpointPropsType<number>\r\n blurMode?: useBreakpointPropsType<\"blur\" | \"transparent\">\r\n onClickOutside?: () => void;\r\n onOpen?: Function;\r\n onOpened?: Function;\r\n onClose?: Function;\r\n onClosed?: Function;\r\n slotProps?: {\r\n root?: Omit<TagProps<\"div\">, \"children\">;\r\n transition?: Omit<TransitionProps, \"children\" | \"open\" | \"variant\" | \"onClose\" | \"onClosed\" | \"onOpen\" | \"onOpened\">;\r\n content?: Omit<TagProps<\"div\">, \"children\">;\r\n clickOutside?: Omit<ClickOutsideProps, \"children\">;\r\n }\r\n}\r\n\r\nconst Layer = ({ children, open, ...props }: LayerProps) => {\r\n let [{\r\n onClickOutside,\r\n placement,\r\n transition,\r\n zIndex,\r\n blur,\r\n blurMode,\r\n onOpen,\r\n onOpened,\r\n onClose,\r\n onClosed,\r\n slotProps\r\n }] = useInterface<any>(\"Layer\", props, {})\r\n\r\n const _p: any = {}\r\n if (blur) _p.blur = blur\r\n if (blurMode) _p.blurMode = blurMode\r\n const p: any = useBreakpointProps(_p)\r\n\r\n blur = p.blur\r\n blurMode = p.blurMode\r\n\r\n const [closed, setClosed] = useState(!open)\r\n placement = placement || \"bottom-left\"\r\n const blurCss = blur ? useBlurCss(blur, blurMode) : {}\r\n\r\n useEffect(() => {\r\n if (closed && open) {\r\n setClosed(false)\r\n }\r\n }, [open])\r\n\r\n if (closed) return <></>\r\n let duration = slotProps?.transition?.duration || 300\r\n let delay = slotProps?.transition?.delay || 0\r\n\r\n let content = <Transition\r\n duration={duration}\r\n delay={delay}\r\n easing=\"standard\"\r\n variant={transition || \"zoomOver\"}\r\n {...slotProps?.transition}\r\n open={open}\r\n onOpen={onOpen}\r\n onOpened={onOpened}\r\n onClose={onClose}\r\n onClosed={() => {\r\n setClosed(true)\r\n onClosed && onClosed()\r\n }}\r\n >\r\n {children}\r\n </Transition>\r\n\r\n return (\r\n <Transition\r\n duration={duration}\r\n delay={delay}\r\n easing=\"smooth\"\r\n variant={\"fade\"}\r\n open={open}\r\n >\r\n <Tag\r\n baseClass=\"layer\"\r\n {...slotProps?.root}\r\n sxr={{\r\n ...slotProps?.root?.sx,\r\n position: \"fixed\",\r\n zIndex: 1500 + (zIndex || 0),\r\n top: 0,\r\n left: 0,\r\n bottom: 0,\r\n right: 0,\r\n width: \"100%\",\r\n height: \"100%\",\r\n ...blurCss\r\n }}\r\n >\r\n {\r\n onClickOutside ? <ClickOutside\r\n {...slotProps?.clickOutside}\r\n onClickOutside={onClickOutside || (() => { })}\r\n >\r\n {content}\r\n </ClickOutside> : content\r\n }\r\n </Tag>\r\n </Transition>\r\n )\r\n}\r\n\r\n\r\nLayer.open = (children: LayerProps['children'], props?: Partial<Omit<LayerProps, 'children'>>) => {\r\n const l = Renderar.render(Layer as any, {\r\n open: true,\r\n ...props,\r\n children,\r\n onClosed: () => {\r\n Renderar.unrender(Layer as any)\r\n if (props?.onClosed) {\r\n props.onClosed()\r\n }\r\n }\r\n })\r\n return {\r\n open: () => {\r\n l.updateProps({ open: true })\r\n },\r\n close: () => {\r\n l.updateProps({ open: false })\r\n },\r\n }\r\n}\r\nLayer.close = () => {\r\n Renderar.unrender(Layer as any)\r\n}\r\nexport default Layer"],"names":[],"mappings":";;;;;;;;;;AA2BA;;;AACI;;AAeA;AAAU;AACV;AAAc;AACd;AAEA;AACA;;AAGA;AACA;;AAGI;;;AAGJ;AAEA;AAAY;AACZ;AACA;;;;;AAoBA;AAmCJ;AAGA;AACI;AAKQ;;;;AAIJ;;;;;;;;;AAUR;AACA;AACI;AACJ;;"}
|
package/Layer/index.mjs
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import { __rest } from 'tslib';
|
|
3
|
+
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
4
|
+
import { useState, useEffect } from 'react';
|
|
5
|
+
import { useInterface, useBreakpointProps, Transition, Tag, Renderar } from '@xanui/core';
|
|
6
|
+
import useBlurCss from '../useBlurCss/index.mjs';
|
|
7
|
+
import ClickOutside from '../ClickOutside/index.mjs';
|
|
8
|
+
|
|
9
|
+
const Layer = (_a) => {
|
|
2
10
|
var _b, _c, _d;
|
|
3
11
|
var { children, open } = _a, props = __rest(_a, ["children", "open"]);
|
|
4
12
|
let [{ onClickOutside, placement, transition, zIndex, blur, blurMode, onOpen, onOpened, onClose, onClosed, slotProps }] = useInterface("Layer", props, {});
|
|
@@ -46,4 +54,7 @@ Layer.open = (children, props) => {
|
|
|
46
54
|
};
|
|
47
55
|
Layer.close = () => {
|
|
48
56
|
Renderar.unrender(Layer);
|
|
49
|
-
};
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export { Layer as default };
|
|
60
|
+
//# sourceMappingURL=index.mjs.map
|
package/Layer/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../src/Layer/index.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../src/Layer/index.tsx"],"sourcesContent":["\"use client\";\r\nimport { ReactNode, useEffect, useState } from 'react'\r\nimport { Tag, TagProps, useBreakpointProps, useBreakpointPropsType, useInterface, TransitionProps, Transition } from \"@xanui/core\"\r\nimport useBlurCss from '../useBlurCss';\r\nimport { Renderar } from \"@xanui/core\";\r\nimport ClickOutside, { ClickOutsideProps } from '../ClickOutside';\r\n\r\nexport type LayerProps = {\r\n open: boolean;\r\n children: ReactNode;\r\n transition?: TransitionProps['variant'];\r\n zIndex?: number;\r\n blur?: useBreakpointPropsType<number>\r\n blurMode?: useBreakpointPropsType<\"blur\" | \"transparent\">\r\n onClickOutside?: () => void;\r\n onOpen?: Function;\r\n onOpened?: Function;\r\n onClose?: Function;\r\n onClosed?: Function;\r\n slotProps?: {\r\n root?: Omit<TagProps<\"div\">, \"children\">;\r\n transition?: Omit<TransitionProps, \"children\" | \"open\" | \"variant\" | \"onClose\" | \"onClosed\" | \"onOpen\" | \"onOpened\">;\r\n content?: Omit<TagProps<\"div\">, \"children\">;\r\n clickOutside?: Omit<ClickOutsideProps, \"children\">;\r\n }\r\n}\r\n\r\nconst Layer = ({ children, open, ...props }: LayerProps) => {\r\n let [{\r\n onClickOutside,\r\n placement,\r\n transition,\r\n zIndex,\r\n blur,\r\n blurMode,\r\n onOpen,\r\n onOpened,\r\n onClose,\r\n onClosed,\r\n slotProps\r\n }] = useInterface<any>(\"Layer\", props, {})\r\n\r\n const _p: any = {}\r\n if (blur) _p.blur = blur\r\n if (blurMode) _p.blurMode = blurMode\r\n const p: any = useBreakpointProps(_p)\r\n\r\n blur = p.blur\r\n blurMode = p.blurMode\r\n\r\n const [closed, setClosed] = useState(!open)\r\n placement = placement || \"bottom-left\"\r\n const blurCss = blur ? useBlurCss(blur, blurMode) : {}\r\n\r\n useEffect(() => {\r\n if (closed && open) {\r\n setClosed(false)\r\n }\r\n }, [open])\r\n\r\n if (closed) return <></>\r\n let duration = slotProps?.transition?.duration || 300\r\n let delay = slotProps?.transition?.delay || 0\r\n\r\n let content = <Transition\r\n duration={duration}\r\n delay={delay}\r\n easing=\"standard\"\r\n variant={transition || \"zoomOver\"}\r\n {...slotProps?.transition}\r\n open={open}\r\n onOpen={onOpen}\r\n onOpened={onOpened}\r\n onClose={onClose}\r\n onClosed={() => {\r\n setClosed(true)\r\n onClosed && onClosed()\r\n }}\r\n >\r\n {children}\r\n </Transition>\r\n\r\n return (\r\n <Transition\r\n duration={duration}\r\n delay={delay}\r\n easing=\"smooth\"\r\n variant={\"fade\"}\r\n open={open}\r\n >\r\n <Tag\r\n baseClass=\"layer\"\r\n {...slotProps?.root}\r\n sxr={{\r\n ...slotProps?.root?.sx,\r\n position: \"fixed\",\r\n zIndex: 1500 + (zIndex || 0),\r\n top: 0,\r\n left: 0,\r\n bottom: 0,\r\n right: 0,\r\n width: \"100%\",\r\n height: \"100%\",\r\n ...blurCss\r\n }}\r\n >\r\n {\r\n onClickOutside ? <ClickOutside\r\n {...slotProps?.clickOutside}\r\n onClickOutside={onClickOutside || (() => { })}\r\n >\r\n {content}\r\n </ClickOutside> : content\r\n }\r\n </Tag>\r\n </Transition>\r\n )\r\n}\r\n\r\n\r\nLayer.open = (children: LayerProps['children'], props?: Partial<Omit<LayerProps, 'children'>>) => {\r\n const l = Renderar.render(Layer as any, {\r\n open: true,\r\n ...props,\r\n children,\r\n onClosed: () => {\r\n Renderar.unrender(Layer as any)\r\n if (props?.onClosed) {\r\n props.onClosed()\r\n }\r\n }\r\n })\r\n return {\r\n open: () => {\r\n l.updateProps({ open: true })\r\n },\r\n close: () => {\r\n l.updateProps({ open: false })\r\n },\r\n }\r\n}\r\nLayer.close = () => {\r\n Renderar.unrender(Layer as any)\r\n}\r\nexport default Layer"],"names":[],"mappings":";;;;;;;;AA2BA;;;AACI;;AAeA;AAAU;AACV;AAAc;AACd;AAEA;AACA;;AAGA;AACA;;AAGI;;;AAGJ;AAEA;AAAY;AACZ;AACA;;;;;AAoBA;AAmCJ;AAGA;AACI;AAKQ;;;;AAIJ;;;;;;;;;AAUR;AACA;AACI;AACJ;;"}
|
package/LineProgress/index.js
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var tslib = require('tslib');
|
|
5
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var core = require('@xanui/core');
|
|
8
|
+
|
|
9
|
+
const LineProgress = React.forwardRef((_a, ref) => {
|
|
2
10
|
var _b, _c;
|
|
3
11
|
var { children } = _a, props = tslib.__rest(_a, ["children"]);
|
|
4
12
|
const uid = "line-progress" + React.useId().replace(":", "");
|
|
@@ -45,4 +53,7 @@
|
|
|
45
53
|
"100%": { left: "100%", width: "100%" }
|
|
46
54
|
}
|
|
47
55
|
} }) }));
|
|
48
|
-
});
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
module.exports = LineProgress;
|
|
59
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/LineProgress/index.tsx"],"sourcesContent":["\nimport React, { ReactElement, useId } from \"react\"\nimport { Tag, useBreakpointProps, UseColorTemplateColor, useInterface, useBreakpointPropsType } from '@xanui/core';\n\nexport type LineProgressProps = {\n children?: ReactElement;\n thumbSize?: useBreakpointPropsType<number>;\n color?: useBreakpointPropsType<UseColorTemplateColor>;\n value?: useBreakpointPropsType<number>;\n hideTrack?: useBreakpointPropsType<boolean>;\n speed?: useBreakpointPropsType<number>;\n}\n\n\nconst LineProgress = React.forwardRef(({ children, ...props }: LineProgressProps, ref: React.Ref<any>) => {\n const uid = \"line-progress\" + useId().replace(\":\", \"\")\n let [{ color, value, thumbSize, hideTrack, speed }] = useInterface<any>(\"LineProgress\", props, {})\n const _p: any = {}\n if (thumbSize) _p.thumbSize = thumbSize\n if (color) _p.color = color\n if (value) _p.value = value\n if (hideTrack) _p.hideTrack = hideTrack\n if (speed) _p.speed = speed\n const p: any = useBreakpointProps(_p)\n\n thumbSize = p.thumbSize ?? 4\n color = p.color ?? \"brand\"\n value = p.value\n hideTrack = p.hideTrack\n speed = p.speed\n\n let isVal = typeof value === 'number'\n if (isVal && (value as number) > 100) value = 100\n\n return (\n <Tag\n baseClass='line-progress'\n sxr={{\n display: \"flex\",\n alignItems: \"center\",\n width: '100%',\n height: thumbSize,\n position: \"relative\",\n overflow: \"hidden\",\n bgcolor: hideTrack ? \"transparent\" : (color === 'default' ? `text.primary` : `${color}.soft.primary`),\n radius: 2,\n }}\n ref={ref}\n >\n <Tag\n component=\"span\"\n baseClass=\"line-progress-thumb\"\n sxr={{\n bgcolor: color === 'default' ? `divider` : `${color}`,\n width: isVal ? `${value}%` : \"50%\",\n height: thumbSize,\n position: \"absolute\",\n left: 0,\n animation: isVal ? \"none\" : `${uid} ${speed ?? 1}s linear infinite`,\n [`@keyframes ${uid}`]: {\n \"0%\": { left: \"-40%\" },\n \"50%\": { left: \"20%\", width: \"80%\" },\n \"100%\": { left: \"100%\", width: \"100%\" }\n }\n }}\n />\n </Tag >\n )\n})\n\nexport default LineProgress\n\n"],"names":[
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/LineProgress/index.tsx"],"sourcesContent":["\"use client\";\r\nimport React, { ReactElement, useId } from \"react\"\r\nimport { Tag, useBreakpointProps, UseColorTemplateColor, useInterface, useBreakpointPropsType } from '@xanui/core';\r\n\r\nexport type LineProgressProps = {\r\n children?: ReactElement;\r\n thumbSize?: useBreakpointPropsType<number>;\r\n color?: useBreakpointPropsType<UseColorTemplateColor>;\r\n value?: useBreakpointPropsType<number>;\r\n hideTrack?: useBreakpointPropsType<boolean>;\r\n speed?: useBreakpointPropsType<number>;\r\n}\r\n\r\n\r\nconst LineProgress = React.forwardRef(({ children, ...props }: LineProgressProps, ref: React.Ref<any>) => {\r\n const uid = \"line-progress\" + useId().replace(\":\", \"\")\r\n let [{ color, value, thumbSize, hideTrack, speed }] = useInterface<any>(\"LineProgress\", props, {})\r\n const _p: any = {}\r\n if (thumbSize) _p.thumbSize = thumbSize\r\n if (color) _p.color = color\r\n if (value) _p.value = value\r\n if (hideTrack) _p.hideTrack = hideTrack\r\n if (speed) _p.speed = speed\r\n const p: any = useBreakpointProps(_p)\r\n\r\n thumbSize = p.thumbSize ?? 4\r\n color = p.color ?? \"brand\"\r\n value = p.value\r\n hideTrack = p.hideTrack\r\n speed = p.speed\r\n\r\n let isVal = typeof value === 'number'\r\n if (isVal && (value as number) > 100) value = 100\r\n\r\n return (\r\n <Tag\r\n baseClass='line-progress'\r\n sxr={{\r\n display: \"flex\",\r\n alignItems: \"center\",\r\n width: '100%',\r\n height: thumbSize,\r\n position: \"relative\",\r\n overflow: \"hidden\",\r\n bgcolor: hideTrack ? \"transparent\" : (color === 'default' ? `text.primary` : `${color}.soft.primary`),\r\n radius: 2,\r\n }}\r\n ref={ref}\r\n >\r\n <Tag\r\n component=\"span\"\r\n baseClass=\"line-progress-thumb\"\r\n sxr={{\r\n bgcolor: color === 'default' ? `divider` : `${color}`,\r\n width: isVal ? `${value}%` : \"50%\",\r\n height: thumbSize,\r\n position: \"absolute\",\r\n left: 0,\r\n animation: isVal ? \"none\" : `${uid} ${speed ?? 1}s linear infinite`,\r\n [`@keyframes ${uid}`]: {\r\n \"0%\": { left: \"-40%\" },\r\n \"50%\": { left: \"20%\", width: \"80%\" },\r\n \"100%\": { left: \"100%\", width: \"100%\" }\r\n }\r\n }}\r\n />\r\n </Tag >\r\n )\r\n})\r\n\r\nexport default LineProgress\r\n\r\n"],"names":[],"mappings":";;;;;;;;AAcA;;AAAuC;AACnC;;;AAGA;AAAe;AACf;AAAW;AACX;AAAW;AACX;AAAe;AACf;AAAW;AACX;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;;;AAMY;AACA;AACA;AACA;AACA;AACA;;AAEA;AACH;AAOO;;AAEA;AACA;AACA;AACA;AACA;AACI;;;AAGH;;AAKrB;;"}
|
package/LineProgress/index.mjs
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import { __rest } from 'tslib';
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
import React, { useId } from 'react';
|
|
5
|
+
import { useInterface, useBreakpointProps, Tag } from '@xanui/core';
|
|
6
|
+
|
|
7
|
+
const LineProgress = React.forwardRef((_a, ref) => {
|
|
2
8
|
var _b, _c;
|
|
3
9
|
var { children } = _a, props = __rest(_a, ["children"]);
|
|
4
10
|
const uid = "line-progress" + useId().replace(":", "");
|
|
@@ -45,4 +51,7 @@ import {__rest}from'tslib';import {jsx}from'react/jsx-runtime';import React,{use
|
|
|
45
51
|
"100%": { left: "100%", width: "100%" }
|
|
46
52
|
}
|
|
47
53
|
} }) }));
|
|
48
|
-
});
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
export { LineProgress as default };
|
|
57
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../src/LineProgress/index.tsx"],"sourcesContent":["\nimport React, { ReactElement, useId } from \"react\"\nimport { Tag, useBreakpointProps, UseColorTemplateColor, useInterface, useBreakpointPropsType } from '@xanui/core';\n\nexport type LineProgressProps = {\n children?: ReactElement;\n thumbSize?: useBreakpointPropsType<number>;\n color?: useBreakpointPropsType<UseColorTemplateColor>;\n value?: useBreakpointPropsType<number>;\n hideTrack?: useBreakpointPropsType<boolean>;\n speed?: useBreakpointPropsType<number>;\n}\n\n\nconst LineProgress = React.forwardRef(({ children, ...props }: LineProgressProps, ref: React.Ref<any>) => {\n const uid = \"line-progress\" + useId().replace(\":\", \"\")\n let [{ color, value, thumbSize, hideTrack, speed }] = useInterface<any>(\"LineProgress\", props, {})\n const _p: any = {}\n if (thumbSize) _p.thumbSize = thumbSize\n if (color) _p.color = color\n if (value) _p.value = value\n if (hideTrack) _p.hideTrack = hideTrack\n if (speed) _p.speed = speed\n const p: any = useBreakpointProps(_p)\n\n thumbSize = p.thumbSize ?? 4\n color = p.color ?? \"brand\"\n value = p.value\n hideTrack = p.hideTrack\n speed = p.speed\n\n let isVal = typeof value === 'number'\n if (isVal && (value as number) > 100) value = 100\n\n return (\n <Tag\n baseClass='line-progress'\n sxr={{\n display: \"flex\",\n alignItems: \"center\",\n width: '100%',\n height: thumbSize,\n position: \"relative\",\n overflow: \"hidden\",\n bgcolor: hideTrack ? \"transparent\" : (color === 'default' ? `text.primary` : `${color}.soft.primary`),\n radius: 2,\n }}\n ref={ref}\n >\n <Tag\n component=\"span\"\n baseClass=\"line-progress-thumb\"\n sxr={{\n bgcolor: color === 'default' ? `divider` : `${color}`,\n width: isVal ? `${value}%` : \"50%\",\n height: thumbSize,\n position: \"absolute\",\n left: 0,\n animation: isVal ? \"none\" : `${uid} ${speed ?? 1}s linear infinite`,\n [`@keyframes ${uid}`]: {\n \"0%\": { left: \"-40%\" },\n \"50%\": { left: \"20%\", width: \"80%\" },\n \"100%\": { left: \"100%\", width: \"100%\" }\n }\n }}\n />\n </Tag >\n )\n})\n\nexport default LineProgress\n\n"],"names":[
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../src/LineProgress/index.tsx"],"sourcesContent":["\"use client\";\r\nimport React, { ReactElement, useId } from \"react\"\r\nimport { Tag, useBreakpointProps, UseColorTemplateColor, useInterface, useBreakpointPropsType } from '@xanui/core';\r\n\r\nexport type LineProgressProps = {\r\n children?: ReactElement;\r\n thumbSize?: useBreakpointPropsType<number>;\r\n color?: useBreakpointPropsType<UseColorTemplateColor>;\r\n value?: useBreakpointPropsType<number>;\r\n hideTrack?: useBreakpointPropsType<boolean>;\r\n speed?: useBreakpointPropsType<number>;\r\n}\r\n\r\n\r\nconst LineProgress = React.forwardRef(({ children, ...props }: LineProgressProps, ref: React.Ref<any>) => {\r\n const uid = \"line-progress\" + useId().replace(\":\", \"\")\r\n let [{ color, value, thumbSize, hideTrack, speed }] = useInterface<any>(\"LineProgress\", props, {})\r\n const _p: any = {}\r\n if (thumbSize) _p.thumbSize = thumbSize\r\n if (color) _p.color = color\r\n if (value) _p.value = value\r\n if (hideTrack) _p.hideTrack = hideTrack\r\n if (speed) _p.speed = speed\r\n const p: any = useBreakpointProps(_p)\r\n\r\n thumbSize = p.thumbSize ?? 4\r\n color = p.color ?? \"brand\"\r\n value = p.value\r\n hideTrack = p.hideTrack\r\n speed = p.speed\r\n\r\n let isVal = typeof value === 'number'\r\n if (isVal && (value as number) > 100) value = 100\r\n\r\n return (\r\n <Tag\r\n baseClass='line-progress'\r\n sxr={{\r\n display: \"flex\",\r\n alignItems: \"center\",\r\n width: '100%',\r\n height: thumbSize,\r\n position: \"relative\",\r\n overflow: \"hidden\",\r\n bgcolor: hideTrack ? \"transparent\" : (color === 'default' ? `text.primary` : `${color}.soft.primary`),\r\n radius: 2,\r\n }}\r\n ref={ref}\r\n >\r\n <Tag\r\n component=\"span\"\r\n baseClass=\"line-progress-thumb\"\r\n sxr={{\r\n bgcolor: color === 'default' ? `divider` : `${color}`,\r\n width: isVal ? `${value}%` : \"50%\",\r\n height: thumbSize,\r\n position: \"absolute\",\r\n left: 0,\r\n animation: isVal ? \"none\" : `${uid} ${speed ?? 1}s linear infinite`,\r\n [`@keyframes ${uid}`]: {\r\n \"0%\": { left: \"-40%\" },\r\n \"50%\": { left: \"20%\", width: \"80%\" },\r\n \"100%\": { left: \"100%\", width: \"100%\" }\r\n }\r\n }}\r\n />\r\n </Tag >\r\n )\r\n})\r\n\r\nexport default LineProgress\r\n\r\n"],"names":[],"mappings":";;;;;;AAcA;;AAAuC;AACnC;;;AAGA;AAAe;AACf;AAAW;AACX;AAAW;AACX;AAAe;AACf;AAAW;AACX;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;;;AAMY;AACA;AACA;AACA;AACA;AACA;;AAEA;AACH;AAOO;;AAEA;AACA;AACA;AACA;AACA;AACI;;;AAGH;;AAKrB;;"}
|
package/List/index.js
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
'use strict';
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var tslib = require('tslib');
|
|
4
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
+
var React = require('react');
|
|
6
|
+
var core = require('@xanui/core');
|
|
7
|
+
|
|
8
|
+
const List = React.forwardRef((_a, ref) => {
|
|
2
9
|
var _b, _c, _d, _e;
|
|
3
10
|
var { children } = _a, rest = tslib.__rest(_a, ["children"]);
|
|
4
11
|
let [_f] = core.useInterface("List", rest, {}), { sx, color, variant, hoverColor, hoverVariant } = _f, props = tslib.__rest(_f, ["sx", "color", "variant", "hoverColor", "hoverVariant"]);
|
|
@@ -46,4 +53,7 @@
|
|
|
46
53
|
}, "& .list-item-subtitle": {
|
|
47
54
|
color: template.primary.color
|
|
48
55
|
} }) }), (sx || {})), ref: ref, children: children })));
|
|
49
|
-
});
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
module.exports = List;
|
|
59
|
+
//# sourceMappingURL=index.js.map
|
package/List/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/List/index.tsx"],"sourcesContent":["\nimport React from 'react'\nimport { Tag, TagProps, TagComponentType, useInterface, useColorTemplate, UseColorTemplateType, UseColorTemplateColor, useBreakpointProps, useBreakpointPropsType } from '@xanui/core'\n\n\nexport type ListProps<T extends TagComponentType = \"ul\"> = Omit<TagProps<T>, 'color'> & {\n color?: useBreakpointPropsType<UseColorTemplateColor>;\n variant?: useBreakpointPropsType<UseColorTemplateType>;\n hoverColor?: useBreakpointPropsType<UseColorTemplateColor>;\n hoverVariant?: useBreakpointPropsType<UseColorTemplateType>;\n}\n\nconst List = React.forwardRef(<T extends TagComponentType = \"ul\">({ children, ...rest }: ListProps<T>, ref: React.Ref<any>) => {\n let [{ sx, color, variant, hoverColor, hoverVariant, ...props }] = useInterface<any>(\"List\", rest, {})\n const _p: any = {}\n if (color) _p.color = color\n if (variant) _p.variant = variant\n if (hoverColor) _p.hoverColor = hoverColor\n if (hoverVariant) _p.hoverVariant = hoverVariant\n const p: any = useBreakpointProps(_p)\n\n color = p.color ?? \"brand\"\n variant = p.variant ?? \"fill\"\n hoverColor = p.hoverColor ?? \"default\"\n hoverVariant = p.hoverVariant ?? \"soft\"\n\n const template = useColorTemplate(color, variant)\n const hoverTemplate = useColorTemplate(hoverColor, hoverVariant)\n\n let sxOutline: any = {}\n if (hoverVariant == 'outline' || variant === 'outline') {\n sxOutline = {\n \"& .list-item\": {\n border: \"1px solid\",\n borderColor: \"transparent\"\n }\n }\n }\n\n return (\n <Tag\n component='ul'\n {...props}\n baseClass='list'\n sxr={{\n listStyle: \"none\",\n p: 0,\n m: 0,\n ...sxOutline,\n \"& .list-item-icon\": {\n color: \"text.secondary\"\n },\n \"& .list-item-text\": {\n color: \"text.primary\"\n },\n \"& .list-item-subtitle\": {\n color: \"text.secondary\"\n },\n \"& .xui-list-item:not(.list-item-selected):hover\": {\n ...hoverTemplate.primary,\n \"& .list-item-icon\": {\n color: hoverTemplate.primary.color\n },\n \"& .list-item-text\": {\n color: hoverTemplate.primary.color\n },\n \"& .list-item-subtitle\": {\n color: hoverColor === 'default' ? \"text.secondary\" : hoverTemplate.primary.color\n },\n },\n \"& .xui-list-item.list-item-selected\": {\n ...template.primary,\n \"& .list-item-icon\": {\n color: template.primary.color\n },\n \"& .list-item-text\": {\n color: template.primary.color\n },\n \"& .list-item-subtitle\": {\n color: template.primary.color\n },\n },\n ...(sx || {} as any)\n }}\n ref={ref}\n >\n {children}\n </Tag>\n )\n})\n\nexport default List"],"names":["__rest","useInterface","useBreakpointProps","useColorTemplate","_jsx","Tag"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/List/index.tsx"],"sourcesContent":["\r\nimport React from 'react'\r\nimport { Tag, TagProps, TagComponentType, useInterface, useColorTemplate, UseColorTemplateType, UseColorTemplateColor, useBreakpointProps, useBreakpointPropsType } from '@xanui/core'\r\n\r\n\r\nexport type ListProps<T extends TagComponentType = \"ul\"> = Omit<TagProps<T>, 'color'> & {\r\n color?: useBreakpointPropsType<UseColorTemplateColor>;\r\n variant?: useBreakpointPropsType<UseColorTemplateType>;\r\n hoverColor?: useBreakpointPropsType<UseColorTemplateColor>;\r\n hoverVariant?: useBreakpointPropsType<UseColorTemplateType>;\r\n}\r\n\r\nconst List = React.forwardRef(<T extends TagComponentType = \"ul\">({ children, ...rest }: ListProps<T>, ref: React.Ref<any>) => {\r\n let [{ sx, color, variant, hoverColor, hoverVariant, ...props }] = useInterface<any>(\"List\", rest, {})\r\n const _p: any = {}\r\n if (color) _p.color = color\r\n if (variant) _p.variant = variant\r\n if (hoverColor) _p.hoverColor = hoverColor\r\n if (hoverVariant) _p.hoverVariant = hoverVariant\r\n const p: any = useBreakpointProps(_p)\r\n\r\n color = p.color ?? \"brand\"\r\n variant = p.variant ?? \"fill\"\r\n hoverColor = p.hoverColor ?? \"default\"\r\n hoverVariant = p.hoverVariant ?? \"soft\"\r\n\r\n const template = useColorTemplate(color, variant)\r\n const hoverTemplate = useColorTemplate(hoverColor, hoverVariant)\r\n\r\n let sxOutline: any = {}\r\n if (hoverVariant == 'outline' || variant === 'outline') {\r\n sxOutline = {\r\n \"& .list-item\": {\r\n border: \"1px solid\",\r\n borderColor: \"transparent\"\r\n }\r\n }\r\n }\r\n\r\n return (\r\n <Tag\r\n component='ul'\r\n {...props}\r\n baseClass='list'\r\n sxr={{\r\n listStyle: \"none\",\r\n p: 0,\r\n m: 0,\r\n ...sxOutline,\r\n \"& .list-item-icon\": {\r\n color: \"text.secondary\"\r\n },\r\n \"& .list-item-text\": {\r\n color: \"text.primary\"\r\n },\r\n \"& .list-item-subtitle\": {\r\n color: \"text.secondary\"\r\n },\r\n \"& .xui-list-item:not(.list-item-selected):hover\": {\r\n ...hoverTemplate.primary,\r\n \"& .list-item-icon\": {\r\n color: hoverTemplate.primary.color\r\n },\r\n \"& .list-item-text\": {\r\n color: hoverTemplate.primary.color\r\n },\r\n \"& .list-item-subtitle\": {\r\n color: hoverColor === 'default' ? \"text.secondary\" : hoverTemplate.primary.color\r\n },\r\n },\r\n \"& .xui-list-item.list-item-selected\": {\r\n ...template.primary,\r\n \"& .list-item-icon\": {\r\n color: template.primary.color\r\n },\r\n \"& .list-item-text\": {\r\n color: template.primary.color\r\n },\r\n \"& .list-item-subtitle\": {\r\n color: template.primary.color\r\n },\r\n },\r\n ...(sx || {} as any)\r\n }}\r\n ref={ref}\r\n >\r\n {children}\r\n </Tag>\r\n )\r\n})\r\n\r\nexport default List"],"names":["__rest","useInterface","useBreakpointProps","useColorTemplate","_jsx","Tag"],"mappings":";;;;;;;AAYA,MAAM,IAAI,GAAG,KAAK,CAAC,UAAU,CAAC,CAAoC,EAAmC,EAAE,GAAmB,KAAI;;AAA5D,IAAA,IAAA,EAAE,QAAQ,EAAA,GAAA,EAAyB,EAApB,IAAI,GAAAA,YAAA,CAAA,EAAA,EAAnB,YAAqB,CAAF;IACjF,IAAI,CAAA,EAAA,CAAA,GAA+DC,iBAAY,CAAM,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC,EAAjG,EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,YAAY,EAAA,GAAA,EAAY,EAAP,KAAK,GAAAD,YAAA,CAAA,EAAA,EAAxD,CAAA,IAAA,EAAA,OAAA,EAAA,SAAA,EAAA,YAAA,EAAA,cAAA,CAA0D,CAAuC;IACtG,MAAM,EAAE,GAAQ,EAAE;AAClB,IAAA,IAAI,KAAK;AAAE,QAAA,EAAE,CAAC,KAAK,GAAG,KAAK;AAC3B,IAAA,IAAI,OAAO;AAAE,QAAA,EAAE,CAAC,OAAO,GAAG,OAAO;AACjC,IAAA,IAAI,UAAU;AAAE,QAAA,EAAE,CAAC,UAAU,GAAG,UAAU;AAC1C,IAAA,IAAI,YAAY;AAAE,QAAA,EAAE,CAAC,YAAY,GAAG,YAAY;AAChD,IAAA,MAAM,CAAC,GAAQ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AAA,EACD,mBAAmB,EAAE;AACjB,gBAAA,KAAK,EAAE;AACV,aAAA,EACD,uBAAuB,EAAE;AACrB,gBAAA,KAAK,EAAE;AACV,aAAA,EACD,iDAAiD,EAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAC1C,aAAa,CAAC,OAAO,CAAA,EAAA,EACxB,mBAAmB,EAAE;AACjB,oBAAA,KAAK,EAAE,aAAa,CAAC,OAAO,CAAC;AAChC,iBAAA,EACD,mBAAmB,EAAE;AACjB,oBAAA,KAAK,EAAE,aAAa,CAAC,OAAO,CAAC;AAChC,iBAAA,EACD,uBAAuB,EAAE;AACrB,oBAAA,KAAK,EAAE,UAAU,KAAK,SAAS,GAAG,gBAAgB,GAAG,aAAa,CAAC,OAAO,CAAC;AAC9E,iBAAA,EAAA,CAAA,EAEL,qCAAqC,EAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAC9B,QAAQ,CAAC,OAAO,CAAA,EAAA,EACnB,mBAAmB,EAAE;AACjB,oBAAA,KAAK,EAAE,QAAQ,CAAC,OAAO,CAAC;AAC3B,iBAAA,EACD,mBAAmB,EAAE;AACjB,oBAAA,KAAK,EAAE,QAAQ,CAAC,OAAO,CAAC;AAC3B,iBAAA,EACD,uBAAuB,EAAE;AACrB,oBAAA,KAAK,EAAE,QAAQ,CAAC,OAAO,CAAC;AAC3B,iBAAA,EAAA,CAAA,EAAA,CAAA,GAED,EAAE,IAAI,EAAS,EAAC,EAExB,GAAG,EAAE,GAAG,EAAA,QAAA,EAEP,QAAQ,EAAA,CAAA,CACP;AAEd,CAAC;;;;"}
|
package/List/index.mjs
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import {__rest
|
|
1
|
+
import { __rest } from 'tslib';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { useInterface, useBreakpointProps, useColorTemplate, Tag } from '@xanui/core';
|
|
5
|
+
|
|
6
|
+
const List = React.forwardRef((_a, ref) => {
|
|
2
7
|
var _b, _c, _d, _e;
|
|
3
8
|
var { children } = _a, rest = __rest(_a, ["children"]);
|
|
4
9
|
let [_f] = useInterface("List", rest, {}), { sx, color, variant, hoverColor, hoverVariant } = _f, props = __rest(_f, ["sx", "color", "variant", "hoverColor", "hoverVariant"]);
|
|
@@ -46,4 +51,7 @@ import {__rest}from'tslib';import {jsx}from'react/jsx-runtime';import React from
|
|
|
46
51
|
}, "& .list-item-subtitle": {
|
|
47
52
|
color: template.primary.color
|
|
48
53
|
} }) }), (sx || {})), ref: ref, children: children })));
|
|
49
|
-
});
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
export { List as default };
|
|
57
|
+
//# sourceMappingURL=index.mjs.map
|
package/List/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../src/List/index.tsx"],"sourcesContent":["\nimport React from 'react'\nimport { Tag, TagProps, TagComponentType, useInterface, useColorTemplate, UseColorTemplateType, UseColorTemplateColor, useBreakpointProps, useBreakpointPropsType } from '@xanui/core'\n\n\nexport type ListProps<T extends TagComponentType = \"ul\"> = Omit<TagProps<T>, 'color'> & {\n color?: useBreakpointPropsType<UseColorTemplateColor>;\n variant?: useBreakpointPropsType<UseColorTemplateType>;\n hoverColor?: useBreakpointPropsType<UseColorTemplateColor>;\n hoverVariant?: useBreakpointPropsType<UseColorTemplateType>;\n}\n\nconst List = React.forwardRef(<T extends TagComponentType = \"ul\">({ children, ...rest }: ListProps<T>, ref: React.Ref<any>) => {\n let [{ sx, color, variant, hoverColor, hoverVariant, ...props }] = useInterface<any>(\"List\", rest, {})\n const _p: any = {}\n if (color) _p.color = color\n if (variant) _p.variant = variant\n if (hoverColor) _p.hoverColor = hoverColor\n if (hoverVariant) _p.hoverVariant = hoverVariant\n const p: any = useBreakpointProps(_p)\n\n color = p.color ?? \"brand\"\n variant = p.variant ?? \"fill\"\n hoverColor = p.hoverColor ?? \"default\"\n hoverVariant = p.hoverVariant ?? \"soft\"\n\n const template = useColorTemplate(color, variant)\n const hoverTemplate = useColorTemplate(hoverColor, hoverVariant)\n\n let sxOutline: any = {}\n if (hoverVariant == 'outline' || variant === 'outline') {\n sxOutline = {\n \"& .list-item\": {\n border: \"1px solid\",\n borderColor: \"transparent\"\n }\n }\n }\n\n return (\n <Tag\n component='ul'\n {...props}\n baseClass='list'\n sxr={{\n listStyle: \"none\",\n p: 0,\n m: 0,\n ...sxOutline,\n \"& .list-item-icon\": {\n color: \"text.secondary\"\n },\n \"& .list-item-text\": {\n color: \"text.primary\"\n },\n \"& .list-item-subtitle\": {\n color: \"text.secondary\"\n },\n \"& .xui-list-item:not(.list-item-selected):hover\": {\n ...hoverTemplate.primary,\n \"& .list-item-icon\": {\n color: hoverTemplate.primary.color\n },\n \"& .list-item-text\": {\n color: hoverTemplate.primary.color\n },\n \"& .list-item-subtitle\": {\n color: hoverColor === 'default' ? \"text.secondary\" : hoverTemplate.primary.color\n },\n },\n \"& .xui-list-item.list-item-selected\": {\n ...template.primary,\n \"& .list-item-icon\": {\n color: template.primary.color\n },\n \"& .list-item-text\": {\n color: template.primary.color\n },\n \"& .list-item-subtitle\": {\n color: template.primary.color\n },\n },\n ...(sx || {} as any)\n }}\n ref={ref}\n >\n {children}\n </Tag>\n )\n})\n\nexport default List"],"names":["_jsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../src/List/index.tsx"],"sourcesContent":["\r\nimport React from 'react'\r\nimport { Tag, TagProps, TagComponentType, useInterface, useColorTemplate, UseColorTemplateType, UseColorTemplateColor, useBreakpointProps, useBreakpointPropsType } from '@xanui/core'\r\n\r\n\r\nexport type ListProps<T extends TagComponentType = \"ul\"> = Omit<TagProps<T>, 'color'> & {\r\n color?: useBreakpointPropsType<UseColorTemplateColor>;\r\n variant?: useBreakpointPropsType<UseColorTemplateType>;\r\n hoverColor?: useBreakpointPropsType<UseColorTemplateColor>;\r\n hoverVariant?: useBreakpointPropsType<UseColorTemplateType>;\r\n}\r\n\r\nconst List = React.forwardRef(<T extends TagComponentType = \"ul\">({ children, ...rest }: ListProps<T>, ref: React.Ref<any>) => {\r\n let [{ sx, color, variant, hoverColor, hoverVariant, ...props }] = useInterface<any>(\"List\", rest, {})\r\n const _p: any = {}\r\n if (color) _p.color = color\r\n if (variant) _p.variant = variant\r\n if (hoverColor) _p.hoverColor = hoverColor\r\n if (hoverVariant) _p.hoverVariant = hoverVariant\r\n const p: any = useBreakpointProps(_p)\r\n\r\n color = p.color ?? \"brand\"\r\n variant = p.variant ?? \"fill\"\r\n hoverColor = p.hoverColor ?? \"default\"\r\n hoverVariant = p.hoverVariant ?? \"soft\"\r\n\r\n const template = useColorTemplate(color, variant)\r\n const hoverTemplate = useColorTemplate(hoverColor, hoverVariant)\r\n\r\n let sxOutline: any = {}\r\n if (hoverVariant == 'outline' || variant === 'outline') {\r\n sxOutline = {\r\n \"& .list-item\": {\r\n border: \"1px solid\",\r\n borderColor: \"transparent\"\r\n }\r\n }\r\n }\r\n\r\n return (\r\n <Tag\r\n component='ul'\r\n {...props}\r\n baseClass='list'\r\n sxr={{\r\n listStyle: \"none\",\r\n p: 0,\r\n m: 0,\r\n ...sxOutline,\r\n \"& .list-item-icon\": {\r\n color: \"text.secondary\"\r\n },\r\n \"& .list-item-text\": {\r\n color: \"text.primary\"\r\n },\r\n \"& .list-item-subtitle\": {\r\n color: \"text.secondary\"\r\n },\r\n \"& .xui-list-item:not(.list-item-selected):hover\": {\r\n ...hoverTemplate.primary,\r\n \"& .list-item-icon\": {\r\n color: hoverTemplate.primary.color\r\n },\r\n \"& .list-item-text\": {\r\n color: hoverTemplate.primary.color\r\n },\r\n \"& .list-item-subtitle\": {\r\n color: hoverColor === 'default' ? \"text.secondary\" : hoverTemplate.primary.color\r\n },\r\n },\r\n \"& .xui-list-item.list-item-selected\": {\r\n ...template.primary,\r\n \"& .list-item-icon\": {\r\n color: template.primary.color\r\n },\r\n \"& .list-item-text\": {\r\n color: template.primary.color\r\n },\r\n \"& .list-item-subtitle\": {\r\n color: template.primary.color\r\n },\r\n },\r\n ...(sx || {} as any)\r\n }}\r\n ref={ref}\r\n >\r\n {children}\r\n </Tag>\r\n )\r\n})\r\n\r\nexport default List"],"names":["_jsx"],"mappings":";;;;;AAYA,MAAM,IAAI,GAAG,KAAK,CAAC,UAAU,CAAC,CAAoC,EAAmC,EAAE,GAAmB,KAAI;;AAA5D,IAAA,IAAA,EAAE,QAAQ,EAAA,GAAA,EAAyB,EAApB,IAAI,GAAA,MAAA,CAAA,EAAA,EAAnB,YAAqB,CAAF;IACjF,IAAI,CAAA,EAAA,CAAA,GAA+D,YAAY,CAAM,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC,EAAjG,EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,YAAY,EAAA,GAAA,EAAY,EAAP,KAAK,GAAA,MAAA,CAAA,EAAA,EAAxD,CAAA,IAAA,EAAA,OAAA,EAAA,SAAA,EAAA,YAAA,EAAA,cAAA,CAA0D,CAAuC;IACtG,MAAM,EAAE,GAAQ,EAAE;AAClB,IAAA,IAAI,KAAK;AAAE,QAAA,EAAE,CAAC,KAAK,GAAG,KAAK;AAC3B,IAAA,IAAI,OAAO;AAAE,QAAA,EAAE,CAAC,OAAO,GAAG,OAAO;AACjC,IAAA,IAAI,UAAU;AAAE,QAAA,EAAE,CAAC,UAAU,GAAG,UAAU;AAC1C,IAAA,IAAI,YAAY;AAAE,QAAA,EAAE,CAAC,YAAY,GAAG,YAAY;AAChD,IAAA,MAAM,CAAC,GAAQ,kBAAkB,CAAC,EAAE,CAAC;AAErC,IAAA,KAAK,GAAG,CAAA,EAAA,GAAA,CAAC,CAAC,KAAK,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,EAAA,GAAI,OAAO;AAC1B,IAAA,OAAO,GAAG,CAAA,EAAA,GAAA,CAAC,CAAC,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,OAAO,CAAA,EAAA,EACxB,mBAAmB,EAAE;AACjB,oBAAA,KAAK,EAAE,aAAa,CAAC,OAAO,CAAC;AAChC,iBAAA,EACD,mBAAmB,EAAE;AACjB,oBAAA,KAAK,EAAE,aAAa,CAAC,OAAO,CAAC;AAChC,iBAAA,EACD,uBAAuB,EAAE;AACrB,oBAAA,KAAK,EAAE,UAAU,KAAK,SAAS,GAAG,gBAAgB,GAAG,aAAa,CAAC,OAAO,CAAC;AAC9E,iBAAA,EAAA,CAAA,EAEL,qCAAqC,EAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAC9B,QAAQ,CAAC,OAAO,CAAA,EAAA,EACnB,mBAAmB,EAAE;AACjB,oBAAA,KAAK,EAAE,QAAQ,CAAC,OAAO,CAAC;AAC3B,iBAAA,EACD,mBAAmB,EAAE;AACjB,oBAAA,KAAK,EAAE,QAAQ,CAAC,OAAO,CAAC;AAC3B,iBAAA,EACD,uBAAuB,EAAE;AACrB,oBAAA,KAAK,EAAE,QAAQ,CAAC,OAAO,CAAC;AAC3B,iBAAA,EAAA,CAAA,EAAA,CAAA,GAED,EAAE,IAAI,EAAS,EAAC,EAExB,GAAG,EAAE,GAAG,EAAA,QAAA,EAEP,QAAQ,EAAA,CAAA,CACP;AAEd,CAAC;;;;"}
|
package/ListItem/index.js
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
'use strict';
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var tslib = require('tslib');
|
|
4
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
+
var React = require('react');
|
|
6
|
+
var core = require('@xanui/core');
|
|
7
|
+
var index = require('../Text/index.js');
|
|
8
|
+
|
|
9
|
+
const ListItem = React.forwardRef((_a, ref) => {
|
|
2
10
|
var { children, startIcon, endIcon, subtitle } = _a, rest = tslib.__rest(_a, ["children", "startIcon", "endIcon", "subtitle"]);
|
|
3
11
|
let [_b] = core.useInterface("ListItem", rest, {}), { selected } = _b, props = tslib.__rest(_b, ["selected"]);
|
|
4
12
|
const _p = {};
|
|
@@ -22,5 +30,8 @@
|
|
|
22
30
|
p: 1,
|
|
23
31
|
whiteSpace: "nowrap",
|
|
24
32
|
flexShrink: "0",
|
|
25
|
-
}, baseClass: 'list-item', classNames: [{ "list-item-selected": selected }, ...(props.classNames || [])], ref: ref, children: [startIcon && jsxRuntime.jsx(core.Tag, { mr: 1, component: "span", display: "inline-block", className: 'list-item-icon', children: startIcon }), jsxRuntime.jsxs(core.Tag, { flex: 1, children: [jsxRuntime.jsx(index
|
|
26
|
-
});
|
|
33
|
+
}, baseClass: 'list-item', classNames: [{ "list-item-selected": selected }, ...(props.classNames || [])], ref: ref, children: [startIcon && jsxRuntime.jsx(core.Tag, { mr: 1, component: "span", display: "inline-block", className: 'list-item-icon', children: startIcon }), jsxRuntime.jsxs(core.Tag, { flex: 1, children: [jsxRuntime.jsx(index, { variant: "text", className: 'list-item-text', component: typeof children === "string" || typeof children === "number" ? "p" : "div", children: children }), subtitle && jsxRuntime.jsx(index, { variant: "text", fontSize: "button", className: 'list-item-subtitle', component: typeof subtitle === "string" || typeof subtitle === "number" ? "p" : "div", children: subtitle })] }), endIcon && jsxRuntime.jsx(core.Tag, { ml: 1, component: "span", display: "inline-block", className: 'list-item-icon', children: endIcon })] })));
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
module.exports = ListItem;
|
|
37
|
+
//# sourceMappingURL=index.js.map
|
package/ListItem/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/ListItem/index.tsx"],"sourcesContent":["\nimport React, { ReactElement } from 'react'\nimport { Tag, TagProps, TagComponentType, useInterface, useBreakpointProps, useBreakpointPropsType } from '@xanui/core'\nimport Text from '../Text';\n\n\nexport type ListItemProps<T extends TagComponentType = \"li\"> = TagProps<T> & {\n selected?: boolean;\n subtitle?: useBreakpointPropsType<string | ReactElement>;\n startIcon?: useBreakpointPropsType<ReactElement>;\n endIcon?: useBreakpointPropsType<ReactElement>;\n}\n\nconst ListItem = React.forwardRef(<T extends TagComponentType = \"li\">({ children, startIcon, endIcon, subtitle, ...rest }: ListItemProps<T>, ref: React.Ref<any>) => {\n let [{ selected, ...props }] = useInterface<any>(\"ListItem\", rest, {})\n const _p: any = {}\n if (subtitle) _p.subtitle = subtitle\n if (startIcon) _p.startIcon = startIcon\n if (endIcon) _p.endIcon = endIcon\n const p: any = useBreakpointProps(_p)\n\n subtitle = p.subtitle\n startIcon = p.startIcon\n endIcon = p.endIcon\n\n return (\n <Tag\n component='li'\n {...props}\n sxr={{\n alignItems: \"center\",\n display: \"flex\",\n flexDirection: \"row\",\n userSelect: \"none\",\n cursor: \"pointer\",\n lineHeight: 1.4,\n p: 1,\n whiteSpace: \"nowrap\",\n flexShrink: \"0\",\n }}\n baseClass='list-item'\n classNames={[{ \"list-item-selected\": selected as boolean }, ...(props.classNames || [])]}\n ref={ref}\n >\n {startIcon && <Tag mr={1} component=\"span\" display=\"inline-block\" className='list-item-icon'>{startIcon as any}</Tag>}\n <Tag flex={1}>\n <Text\n variant=\"text\"\n className='list-item-text'\n component={typeof children === \"string\" || typeof children === \"number\" ? \"p\" : \"div\"}\n >\n {children}\n </Text>\n {\n subtitle && <Text\n variant=\"text\"\n fontSize=\"button\"\n className='list-item-subtitle'\n component={typeof subtitle === \"string\" || typeof subtitle === \"number\" ? \"p\" : \"div\"}\n >{subtitle as any}</Text>\n }\n </Tag>\n {endIcon && <Tag ml={1} component=\"span\" display=\"inline-block\" className='list-item-icon'>{endIcon as any}</Tag>}\n </Tag>\n )\n})\n\nexport default ListItem"],"names":["__rest","useInterface","useBreakpointProps","_jsxs","Tag","_jsx","Text"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/ListItem/index.tsx"],"sourcesContent":["\r\nimport React, { ReactElement } from 'react'\r\nimport { Tag, TagProps, TagComponentType, useInterface, useBreakpointProps, useBreakpointPropsType } from '@xanui/core'\r\nimport Text from '../Text';\r\n\r\n\r\nexport type ListItemProps<T extends TagComponentType = \"li\"> = TagProps<T> & {\r\n selected?: boolean;\r\n subtitle?: useBreakpointPropsType<string | ReactElement>;\r\n startIcon?: useBreakpointPropsType<ReactElement>;\r\n endIcon?: useBreakpointPropsType<ReactElement>;\r\n}\r\n\r\nconst ListItem = React.forwardRef(<T extends TagComponentType = \"li\">({ children, startIcon, endIcon, subtitle, ...rest }: ListItemProps<T>, ref: React.Ref<any>) => {\r\n let [{ selected, ...props }] = useInterface<any>(\"ListItem\", rest, {})\r\n const _p: any = {}\r\n if (subtitle) _p.subtitle = subtitle\r\n if (startIcon) _p.startIcon = startIcon\r\n if (endIcon) _p.endIcon = endIcon\r\n const p: any = useBreakpointProps(_p)\r\n\r\n subtitle = p.subtitle\r\n startIcon = p.startIcon\r\n endIcon = p.endIcon\r\n\r\n return (\r\n <Tag\r\n component='li'\r\n {...props}\r\n sxr={{\r\n alignItems: \"center\",\r\n display: \"flex\",\r\n flexDirection: \"row\",\r\n userSelect: \"none\",\r\n cursor: \"pointer\",\r\n lineHeight: 1.4,\r\n p: 1,\r\n whiteSpace: \"nowrap\",\r\n flexShrink: \"0\",\r\n }}\r\n baseClass='list-item'\r\n classNames={[{ \"list-item-selected\": selected as boolean }, ...(props.classNames || [])]}\r\n ref={ref}\r\n >\r\n {startIcon && <Tag mr={1} component=\"span\" display=\"inline-block\" className='list-item-icon'>{startIcon as any}</Tag>}\r\n <Tag flex={1}>\r\n <Text\r\n variant=\"text\"\r\n className='list-item-text'\r\n component={typeof children === \"string\" || typeof children === \"number\" ? \"p\" : \"div\"}\r\n >\r\n {children}\r\n </Text>\r\n {\r\n subtitle && <Text\r\n variant=\"text\"\r\n fontSize=\"button\"\r\n className='list-item-subtitle'\r\n component={typeof subtitle === \"string\" || typeof subtitle === \"number\" ? \"p\" : \"div\"}\r\n >{subtitle as any}</Text>\r\n }\r\n </Tag>\r\n {endIcon && <Tag ml={1} component=\"span\" display=\"inline-block\" className='list-item-icon'>{endIcon as any}</Tag>}\r\n </Tag>\r\n )\r\n})\r\n\r\nexport default ListItem"],"names":["__rest","useInterface","useBreakpointProps","_jsxs","Tag","_jsx","Text"],"mappings":";;;;;;;;AAaA,MAAM,QAAQ,GAAG,KAAK,CAAC,UAAU,CAAC,CAAoC,EAAqE,EAAE,GAAmB,KAAI;AAA9F,IAAA,IAAA,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAA,GAAA,EAA6B,EAAxB,IAAI,GAAAA,YAAA,CAAA,EAAA,EAAjD,CAAA,UAAA,EAAA,WAAA,EAAA,SAAA,EAAA,UAAA,CAAmD,CAAF;AACnH,IAAA,IAAI,OAA2BC,iBAAY,CAAM,UAAU,EAAE,IAAI,EAAE,EAAE,CAAC,EAAjE,EAAE,QAAQ,EAAA,GAAA,EAAY,EAAP,KAAK,GAAAD,YAAA,CAAA,EAAA,EAApB,CAAA,UAAA,CAAsB,CAA2C;IACtE,MAAM,EAAE,GAAQ,EAAE;AAClB,IAAA,IAAI,QAAQ;AAAE,QAAA,EAAE,CAAC,QAAQ,GAAG,QAAQ;AACpC,IAAA,IAAI,SAAS;AAAE,QAAA,EAAE,CAAC,SAAS,GAAG,SAAS;AACvC,IAAA,IAAI,OAAO;AAAE,QAAA,EAAE,CAAC,OAAO,GAAG,OAAO;AACjC,IAAA,MAAM,CAAC,GAAQE,uBAAkB,CAAC,EAAE,CAAC;AAErC,IAAA,QAAQ,GAAG,CAAC,CAAC,QAAQ;AACrB,IAAA,SAAS,GAAG,CAAC,CAAC,SAAS;AACvB,IAAA,OAAO,GAAG,CAAC,CAAC,OAAO;IAEnB,QACIC,eAAA,CAACC,QAAG,EAAA,MAAA,CAAA,MAAA,CAAA,EACA,SAAS,EAAC,IAAI,EAAA,EACV,KAAK,EAAA,EACT,GAAG,EAAE;AACD,YAAA,UAAU,EAAE,QAAQ;AACpB,YAAA,OAAO,EAAE,MAAM;AACf,YAAA,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AS,EAAC,gBAAgB,EAAA,QAAA,EAAE,OAAc,EAAA,CAAO,CAAA,EAAA,CAAA,CAC/G;AAEd,CAAC;;;;"}
|
package/ListItem/index.mjs
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import {__rest
|
|
1
|
+
import { __rest } from 'tslib';
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { useInterface, useBreakpointProps, Tag } from '@xanui/core';
|
|
5
|
+
import Text from '../Text/index.mjs';
|
|
6
|
+
|
|
7
|
+
const ListItem = React.forwardRef((_a, ref) => {
|
|
2
8
|
var { children, startIcon, endIcon, subtitle } = _a, rest = __rest(_a, ["children", "startIcon", "endIcon", "subtitle"]);
|
|
3
9
|
let [_b] = useInterface("ListItem", rest, {}), { selected } = _b, props = __rest(_b, ["selected"]);
|
|
4
10
|
const _p = {};
|
|
@@ -23,4 +29,7 @@ import {__rest}from'tslib';import {jsxs,jsx}from'react/jsx-runtime';import React
|
|
|
23
29
|
whiteSpace: "nowrap",
|
|
24
30
|
flexShrink: "0",
|
|
25
31
|
}, baseClass: 'list-item', classNames: [{ "list-item-selected": selected }, ...(props.classNames || [])], ref: ref, children: [startIcon && jsx(Tag, { mr: 1, component: "span", display: "inline-block", className: 'list-item-icon', children: startIcon }), jsxs(Tag, { flex: 1, children: [jsx(Text, { variant: "text", className: 'list-item-text', component: typeof children === "string" || typeof children === "number" ? "p" : "div", children: children }), subtitle && jsx(Text, { variant: "text", fontSize: "button", className: 'list-item-subtitle', component: typeof subtitle === "string" || typeof subtitle === "number" ? "p" : "div", children: subtitle })] }), endIcon && jsx(Tag, { ml: 1, component: "span", display: "inline-block", className: 'list-item-icon', children: endIcon })] })));
|
|
26
|
-
});
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
export { ListItem as default };
|
|
35
|
+
//# sourceMappingURL=index.mjs.map
|