@j2-health/design-system 0.5.2 → 0.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/_rolldown/runtime.cjs +0 -12
- package/dist/index.cjs +4 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/index2.js +54 -0
- package/dist/src/AppConfigProvider.cjs +1 -0
- package/dist/src/AppConfigProvider.cjs.map +1 -1
- package/dist/src/components/alert/Alert.cjs +1 -0
- package/dist/src/components/alert/Alert.cjs.map +1 -1
- package/dist/src/components/checkboxTree/TreeNode.cjs +2 -0
- package/dist/src/components/checkboxTree/TreeNode.cjs.map +1 -1
- package/dist/src/components/collapse/Collapse.cjs +1 -0
- package/dist/src/components/collapse/Collapse.cjs.map +1 -1
- package/dist/src/components/drawer/Drawer.cjs +2 -0
- package/dist/src/components/drawer/Drawer.cjs.map +1 -1
- package/dist/src/components/dropdown/Dropdown.cjs +1 -0
- package/dist/src/components/dropdown/Dropdown.cjs.map +1 -1
- package/dist/src/components/filterform/FilterGroup.cjs +1 -0
- package/dist/src/components/filterform/FilterGroup.cjs.map +1 -1
- package/dist/src/components/filterform/FiltersForm.cjs +1 -0
- package/dist/src/components/filterform/FiltersForm.cjs.map +1 -1
- package/dist/src/components/inputnumber/InputNumber.cjs +1 -0
- package/dist/src/components/inputnumber/InputNumber.cjs.map +1 -1
- package/dist/src/components/listpopover/ListPopover.cjs +1 -0
- package/dist/src/components/listpopover/ListPopover.cjs.map +1 -1
- package/dist/src/components/manageColumns/ManageColumnsItem.cjs +1 -0
- package/dist/src/components/manageColumns/ManageColumnsItem.cjs.map +1 -1
- package/dist/src/components/message/useMessage.cjs +1 -0
- package/dist/src/components/message/useMessage.cjs.map +1 -1
- package/dist/src/components/modal/Modal.cjs +1 -0
- package/dist/src/components/modal/Modal.cjs.map +1 -1
- package/dist/src/components/notification/useNotification.cjs +1 -0
- package/dist/src/components/notification/useNotification.cjs.map +1 -1
- package/dist/src/components/notificationModal/NotificationModal.cjs +2 -0
- package/dist/src/components/notificationModal/NotificationModal.cjs.map +1 -1
- package/dist/src/components/pagination/Pagination.cjs +1 -0
- package/dist/src/components/pagination/Pagination.cjs.map +1 -1
- package/dist/src/components/rate/Rate.cjs +2 -0
- package/dist/src/components/rate/Rate.cjs.map +1 -1
- package/dist/src/components/select/AntdSelect.cjs +1 -0
- package/dist/src/components/select/AntdSelect.cjs.map +1 -1
- package/dist/src/components/select/Select.cjs +1 -0
- package/dist/src/components/select/Select.cjs.map +1 -1
- package/dist/src/components/select/SummarizedSelect.cjs +6 -5
- package/dist/src/components/select/SummarizedSelect.cjs.map +1 -1
- package/dist/src/components/select/SummarizedSelect.js +5 -5
- package/dist/src/components/select/SummarizedSelect.js.map +1 -1
- package/dist/src/components/steps/Steps.cjs +1 -0
- package/dist/src/components/steps/Steps.cjs.map +1 -1
- package/dist/src/components/table/Table.cjs +1 -0
- package/dist/src/components/table/Table.cjs.map +1 -1
- package/dist/src/components/tag/Tag.cjs +1 -0
- package/dist/src/components/tag/Tag.cjs.map +1 -1
- package/package.json +1 -1
- package/dist/_virtual/_rolldown/runtime.js +0 -27
- package/dist/src/components/icons/index.cjs +0 -22
- package/dist/src/components/icons/index.cjs.map +0 -1
- package/dist/src/components/icons/index.js +0 -10
- package/dist/src/components/icons/index.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Steps.cjs","names":["useSteps","AntdSteps","cx","CheckIcon"],"sources":["../../../../src/components/steps/Steps.tsx"],"sourcesContent":["import { Steps as AntdSteps, StepsProps } from 'antd'\nimport './Steps.css'\nimport { CheckIcon } from '@phosphor-icons/react'\nimport cx from 'classnames'\nimport { useSteps } from './useSteps'\n\ntype AllProps = StepsProps & {\n items: NonNullable<StepsProps['items']>\n dot?: boolean\n current?: number\n setCurrent?: (current: number) => void\n}\n\ntype Props = Expand<AllProps>\n\nexport const Steps = ({\n items,\n current,\n setCurrent,\n dot = false,\n direction,\n orientation,\n size,\n labelPlacement,\n titlePlacement,\n ...props\n}: Props) => {\n const isVertical = (orientation ?? direction) === 'vertical'\n const totalSteps = items?.length || 0\n\n const { current: currentStep, setCurrent: setCurrentStep } = useSteps({\n current,\n setCurrent,\n totalSteps,\n })\n\n return (\n <AntdSteps\n className=\"j2Steps\"\n {...props}\n orientation={orientation ?? direction}\n titlePlacement={titlePlacement ?? labelPlacement}\n size={size === 'default' ? 'medium' : size}\n current={currentStep}\n onChange={(curr) => setCurrentStep(curr)}\n {...(dot && { type: 'dot' })}\n items={items?.map((item, index) => {\n const { description, ...restItem } = item\n return {\n ...restItem,\n content: item.content ?? description,\n icon:\n !dot && currentStep > index ? (\n <div\n className={cx(\n `check-${size === 'small' ? 'small' : 'medium'}`,\n isVertical ? `vertical-check-icon` : `check-icon`\n )}\n >\n <CheckIcon size={16} />\n </div>\n ) : (\n item.icon\n ),\n }\n })}\n />\n )\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Steps.cjs","names":["useSteps","AntdSteps","cx","CheckIcon"],"sources":["../../../../src/components/steps/Steps.tsx"],"sourcesContent":["import { Steps as AntdSteps, StepsProps } from 'antd'\nimport './Steps.css'\nimport { CheckIcon } from '@phosphor-icons/react'\nimport cx from 'classnames'\nimport { useSteps } from './useSteps'\n\ntype AllProps = StepsProps & {\n items: NonNullable<StepsProps['items']>\n dot?: boolean\n current?: number\n setCurrent?: (current: number) => void\n}\n\ntype Props = Expand<AllProps>\n\nexport const Steps = ({\n items,\n current,\n setCurrent,\n dot = false,\n direction,\n orientation,\n size,\n labelPlacement,\n titlePlacement,\n ...props\n}: Props) => {\n const isVertical = (orientation ?? direction) === 'vertical'\n const totalSteps = items?.length || 0\n\n const { current: currentStep, setCurrent: setCurrentStep } = useSteps({\n current,\n setCurrent,\n totalSteps,\n })\n\n return (\n <AntdSteps\n className=\"j2Steps\"\n {...props}\n orientation={orientation ?? direction}\n titlePlacement={titlePlacement ?? labelPlacement}\n size={size === 'default' ? 'medium' : size}\n current={currentStep}\n onChange={(curr) => setCurrentStep(curr)}\n {...(dot && { type: 'dot' })}\n items={items?.map((item, index) => {\n const { description, ...restItem } = item\n return {\n ...restItem,\n content: item.content ?? description,\n icon:\n !dot && currentStep > index ? (\n <div\n className={cx(\n `check-${size === 'small' ? 'small' : 'medium'}`,\n isVertical ? `vertical-check-icon` : `check-icon`\n )}\n >\n <CheckIcon size={16} />\n </div>\n ) : (\n item.icon\n ),\n }\n })}\n />\n )\n}\n"],"mappings":";;;;;;;;;;AAeA,IAAa,SAAS,EACpB,OACA,SACA,YACA,MAAM,OACN,WACA,aACA,MACA,gBACA,gBACA,GAAG,YACQ;CACX,MAAM,cAAc,eAAe,eAAe;CAClD,MAAM,aAAa,OAAO,UAAU;CAEpC,MAAM,EAAE,SAAS,aAAa,YAAY,mBAAmBA,iBAAAA,SAAS;EACpE;EACA;EACA;CACF,CAAC;CAED,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,KAAAA,OAAD;EACE,WAAU;EACV,GAAI;EACJ,aAAa,eAAe;EAC5B,gBAAgB,kBAAkB;EAClC,MAAM,SAAS,YAAY,WAAW;EACtC,SAAS;EACT,WAAW,SAAS,eAAe,IAAI;EACvC,GAAK,OAAO,EAAE,MAAM,MAAM;EAC1B,OAAO,OAAO,KAAK,MAAM,UAAU;GACjC,MAAM,EAAE,aAAa,GAAG,aAAa;GACrC,OAAO;IACL,GAAG;IACH,SAAS,KAAK,WAAW;IACzB,MACE,CAAC,OAAO,cAAc,QACpB,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;KACE,YAAA,GAAWC,WAAAA,QAAAA,CACT,SAAS,SAAS,UAAU,UAAU,YACtC,aAAa,wBAAwB,YACvC;KAEA,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAACC,sBAAAA,WAAD,EAAW,MAAM,GAAK,CAAA;IACnB,CAAA,IAEL,KAAK;GAEX;EACF,CAAC;CACF,CAAA;AAEL"}
|
|
@@ -4,6 +4,7 @@ const require_Spinner = require("../spinner/Spinner.cjs");
|
|
|
4
4
|
const require_Table_module = require("./Table.module.css.cjs");
|
|
5
5
|
let antd = require("antd");
|
|
6
6
|
let _phosphor_icons_react = require("@phosphor-icons/react");
|
|
7
|
+
_phosphor_icons_react = require_runtime.__toESM(_phosphor_icons_react, 1);
|
|
7
8
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
9
|
let classnames = require("classnames");
|
|
9
10
|
classnames = require_runtime.__toESM(classnames, 1);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Table.cjs","names":["CaretUpIcon","CaretDownIcon","CaretUpDownIcon","Spinner","Tooltip","withDesignSystemPaginationOverrides","cx","s","AntdTable"],"sources":["../../../../src/components/table/Table.tsx"],"sourcesContent":["import { Table as AntdTable, SpinProps, TableProps, Tooltip } from 'antd'\nimport cx from 'classnames'\nimport s from './Table.module.css'\nimport { Spinner } from '../spinner'\nimport { withDesignSystemPaginationOverrides } from '../pagination/Pagination'\nimport {\n CaretDownIcon,\n CaretUpIcon,\n CaretUpDownIcon,\n} from '@phosphor-icons/react'\nimport { ComponentProps, ReactNode } from 'react'\nimport { AnyObject } from 'antd/es/_util/type'\n\ntype MergedProps<T> = TableProps<T> & {\n verticalBorders?: boolean\n alternatingRows?: boolean\n columns?: TableProps<T>['columns']\n paginationTextLabels?: boolean\n}\n\ntype Props<T> = Expand<MergedProps<T>>\n\nexport const defaultSortIcon = ({\n sortOrder,\n}: {\n sortOrder: 'ascend' | 'descend' | null\n}) => {\n if (sortOrder == 'ascend') return <CaretUpIcon />\n if (sortOrder == 'descend') return <CaretDownIcon />\n return <CaretUpDownIcon />\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unnecessary-type-constraint\nconst Table = <T extends unknown = any>({\n verticalBorders,\n alternatingRows,\n paginationTextLabels = false,\n ...props\n}: Props<T>) => {\n const defaultLoadingProps: SpinProps = {\n indicator: <Spinner className=\"!w-fit !h-fit !mx-0 translate-x-[-50%]\" />,\n description: (\n <div className=\"mt-20\">\n <h4>Loading this chart</h4>\n <span className=\"text-lg\">Please wait a moment</span>\n </div>\n ),\n }\n\n const loading: SpinProps | boolean | undefined =\n typeof props.loading == 'object'\n ? { ...props.loading, ...defaultLoadingProps }\n : props.loading && defaultLoadingProps\n\n const isSimpleValue = (\n value: unknown\n ): value is string | number | boolean => {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n typeof value === 'boolean'\n )\n }\n\n // Helper to extract text content from React elements\n const extractTextContent = (node: unknown): string | null => {\n if (isSimpleValue(node)) {\n return String(node)\n }\n\n // Check if it's a React element with simple text children\n if (\n node &&\n typeof node === 'object' &&\n 'props' in node &&\n node.props &&\n typeof node.props === 'object' &&\n 'children' in node.props\n ) {\n const children = node.props.children\n if (isSimpleValue(children)) {\n return String(children)\n }\n }\n\n return null\n }\n\n const columns = props.columns?.map((column) => {\n const hasEllipsis =\n column.ellipsis === true ||\n (typeof column.ellipsis === 'object' && column.ellipsis)\n\n const originalRender = column.render\n\n return {\n ...column,\n sortIcon: column.sortIcon ?? defaultSortIcon,\n ellipsis: hasEllipsis\n ? {\n showTitle: false, // Disable default browser tooltip\n }\n : column.ellipsis,\n render: (value: unknown, record: T, index: number): ReactNode => {\n const renderedContent = originalRender\n ? originalRender(value, record, index)\n : value\n\n // Render null/undefined as dashes with no tooltip\n if (renderedContent == null) {\n return <span className=\"text-j2-text-secondary\">--</span>\n }\n\n // Try to extract text content for tooltip\n const tooltipText = extractTextContent(renderedContent)\n\n // If we can extract text content, wrap with tooltip\n if (tooltipText) {\n // For simple values, wrap in a span\n if (isSimpleValue(renderedContent)) {\n return (\n <Tooltip title={tooltipText} arrow={false}>\n <span className={hasEllipsis ? 'block truncate' : undefined}>\n {renderedContent}\n </span>\n </Tooltip>\n )\n }\n\n // For React elements, wrap the element itself\n return (\n <Tooltip title={tooltipText} arrow={false}>\n <div>{renderedContent as ReactNode}</div>\n </Tooltip>\n )\n }\n\n // Complex components without extractable text - return as is\n return renderedContent as ReactNode\n },\n }\n })\n\n const paginationConfig = props.pagination\n ? withDesignSystemPaginationOverrides(\n typeof props.pagination === 'object' ? props.pagination : {},\n {\n paginationTextLabels,\n isSmall:\n (typeof props.pagination === 'object' &&\n props.pagination.size === 'small') ||\n props.size === 'small',\n }\n )\n : false\n\n return (\n <div\n className={cx(props.className, {\n [s.bordered]: props.bordered && !verticalBorders,\n [s.alternatingRows]: alternatingRows,\n })}\n >\n <AntdTable<T>\n showSorterTooltip={{ target: 'sorter-icon' }}\n {...props}\n loading={loading}\n columns={columns}\n pagination={paginationConfig}\n rowKey={(record) => JSON.stringify(record)}\n locale={{\n emptyText: (\n <div\n style={{ height: props.scroll?.y || 400, width: 'content-fit' }}\n />\n ),\n }}\n />\n </div>\n )\n}\n\ntype ColumnProps<T extends AnyObject> = Expand<\n ComponentProps<typeof AntdTable.Column<T>>\n>\n\nconst TableColumn = <T extends AnyObject>(props: ColumnProps<T>) => {\n return <AntdTable.Column<T> {...props} sortIcon={defaultSortIcon} />\n}\nTableColumn.displayName = 'Table.Column'\n\nTable.Column = TableColumn\nTable.Summary = AntdTable.Summary\n\nexport type { TableColumnType } from 'antd'\nexport { Table }\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Table.cjs","names":["CaretUpIcon","CaretDownIcon","CaretUpDownIcon","Spinner","Tooltip","withDesignSystemPaginationOverrides","cx","s","AntdTable"],"sources":["../../../../src/components/table/Table.tsx"],"sourcesContent":["import { Table as AntdTable, SpinProps, TableProps, Tooltip } from 'antd'\nimport cx from 'classnames'\nimport s from './Table.module.css'\nimport { Spinner } from '../spinner'\nimport { withDesignSystemPaginationOverrides } from '../pagination/Pagination'\nimport {\n CaretDownIcon,\n CaretUpIcon,\n CaretUpDownIcon,\n} from '@phosphor-icons/react'\nimport { ComponentProps, ReactNode } from 'react'\nimport { AnyObject } from 'antd/es/_util/type'\n\ntype MergedProps<T> = TableProps<T> & {\n verticalBorders?: boolean\n alternatingRows?: boolean\n columns?: TableProps<T>['columns']\n paginationTextLabels?: boolean\n}\n\ntype Props<T> = Expand<MergedProps<T>>\n\nexport const defaultSortIcon = ({\n sortOrder,\n}: {\n sortOrder: 'ascend' | 'descend' | null\n}) => {\n if (sortOrder == 'ascend') return <CaretUpIcon />\n if (sortOrder == 'descend') return <CaretDownIcon />\n return <CaretUpDownIcon />\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unnecessary-type-constraint\nconst Table = <T extends unknown = any>({\n verticalBorders,\n alternatingRows,\n paginationTextLabels = false,\n ...props\n}: Props<T>) => {\n const defaultLoadingProps: SpinProps = {\n indicator: <Spinner className=\"!w-fit !h-fit !mx-0 translate-x-[-50%]\" />,\n description: (\n <div className=\"mt-20\">\n <h4>Loading this chart</h4>\n <span className=\"text-lg\">Please wait a moment</span>\n </div>\n ),\n }\n\n const loading: SpinProps | boolean | undefined =\n typeof props.loading == 'object'\n ? { ...props.loading, ...defaultLoadingProps }\n : props.loading && defaultLoadingProps\n\n const isSimpleValue = (\n value: unknown\n ): value is string | number | boolean => {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n typeof value === 'boolean'\n )\n }\n\n // Helper to extract text content from React elements\n const extractTextContent = (node: unknown): string | null => {\n if (isSimpleValue(node)) {\n return String(node)\n }\n\n // Check if it's a React element with simple text children\n if (\n node &&\n typeof node === 'object' &&\n 'props' in node &&\n node.props &&\n typeof node.props === 'object' &&\n 'children' in node.props\n ) {\n const children = node.props.children\n if (isSimpleValue(children)) {\n return String(children)\n }\n }\n\n return null\n }\n\n const columns = props.columns?.map((column) => {\n const hasEllipsis =\n column.ellipsis === true ||\n (typeof column.ellipsis === 'object' && column.ellipsis)\n\n const originalRender = column.render\n\n return {\n ...column,\n sortIcon: column.sortIcon ?? defaultSortIcon,\n ellipsis: hasEllipsis\n ? {\n showTitle: false, // Disable default browser tooltip\n }\n : column.ellipsis,\n render: (value: unknown, record: T, index: number): ReactNode => {\n const renderedContent = originalRender\n ? originalRender(value, record, index)\n : value\n\n // Render null/undefined as dashes with no tooltip\n if (renderedContent == null) {\n return <span className=\"text-j2-text-secondary\">--</span>\n }\n\n // Try to extract text content for tooltip\n const tooltipText = extractTextContent(renderedContent)\n\n // If we can extract text content, wrap with tooltip\n if (tooltipText) {\n // For simple values, wrap in a span\n if (isSimpleValue(renderedContent)) {\n return (\n <Tooltip title={tooltipText} arrow={false}>\n <span className={hasEllipsis ? 'block truncate' : undefined}>\n {renderedContent}\n </span>\n </Tooltip>\n )\n }\n\n // For React elements, wrap the element itself\n return (\n <Tooltip title={tooltipText} arrow={false}>\n <div>{renderedContent as ReactNode}</div>\n </Tooltip>\n )\n }\n\n // Complex components without extractable text - return as is\n return renderedContent as ReactNode\n },\n }\n })\n\n const paginationConfig = props.pagination\n ? withDesignSystemPaginationOverrides(\n typeof props.pagination === 'object' ? props.pagination : {},\n {\n paginationTextLabels,\n isSmall:\n (typeof props.pagination === 'object' &&\n props.pagination.size === 'small') ||\n props.size === 'small',\n }\n )\n : false\n\n return (\n <div\n className={cx(props.className, {\n [s.bordered]: props.bordered && !verticalBorders,\n [s.alternatingRows]: alternatingRows,\n })}\n >\n <AntdTable<T>\n showSorterTooltip={{ target: 'sorter-icon' }}\n {...props}\n loading={loading}\n columns={columns}\n pagination={paginationConfig}\n rowKey={(record) => JSON.stringify(record)}\n locale={{\n emptyText: (\n <div\n style={{ height: props.scroll?.y || 400, width: 'content-fit' }}\n />\n ),\n }}\n />\n </div>\n )\n}\n\ntype ColumnProps<T extends AnyObject> = Expand<\n ComponentProps<typeof AntdTable.Column<T>>\n>\n\nconst TableColumn = <T extends AnyObject>(props: ColumnProps<T>) => {\n return <AntdTable.Column<T> {...props} sortIcon={defaultSortIcon} />\n}\nTableColumn.displayName = 'Table.Column'\n\nTable.Column = TableColumn\nTable.Summary = AntdTable.Summary\n\nexport type { TableColumnType } from 'antd'\nexport { Table }\n"],"mappings":";;;;;;;;;;;AAsBA,IAAa,mBAAmB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,GAAA,kBAAA,IAAA,CAACC,KAAAA,OAAD;GACE,mBAAmB,EAAE,QAAQ,cAAc;GAC3C,GAAI;GACK;GACA;GACT,YAAY;GACZ,SAAS,WAAW,KAAK,UAAU,MAAM;GACzC,QAAQ,EACN,WACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD,EACE,OAAO;IAAE,QAAQ,MAAM,QAAQ,KAAK;IAAK,OAAO;GAAc,EAC/D,CAAA,EAEL;EACD,CAAA;CACE,CAAA;AAET;AAMA,IAAM,eAAoC,UAA0B;CAClE,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAACA,KAAAA,MAAU,QAAX;EAAqB,GAAI;EAAO,UAAU;CAAkB,CAAA;AACrE;AACA,YAAY,cAAc;AAE1B,MAAM,SAAS;AACf,MAAM,UAAUA,KAAAA,MAAU"}
|
|
@@ -5,6 +5,7 @@ let react$1 = require_runtime.__toESM(react, 1);
|
|
|
5
5
|
react = require_runtime.__toESM(react);
|
|
6
6
|
let antd = require("antd");
|
|
7
7
|
let _phosphor_icons_react = require("@phosphor-icons/react");
|
|
8
|
+
_phosphor_icons_react = require_runtime.__toESM(_phosphor_icons_react, 1);
|
|
8
9
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
9
10
|
let classnames = require("classnames");
|
|
10
11
|
classnames = require_runtime.__toESM(classnames, 1);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tag.cjs","names":["XCircleIcon","CheckCircleIcon","WarningCircleIcon","ArrowsClockwiseIcon","GearIcon","React","AntdTag","cx"],"sources":["../../../../src/components/tag/Tag.tsx"],"sourcesContent":["import * as React from 'react'\nimport { Tag as AntdTag, TagProps } from 'antd'\nimport {\n ArrowsClockwiseIcon,\n CheckCircleIcon,\n GearIcon,\n Icon,\n WarningCircleIcon,\n XCircleIcon,\n} from '@phosphor-icons/react'\nimport cx from 'classnames'\nimport './Tag.css'\n\ntype BaseProps = Expand<Omit<TagProps, 'icon'>> & {\n status: 'default' | 'error' | 'success' | 'warning' | 'processing'\n}\n\ntype DefaultSizeProps = BaseProps & {\n size?: 'default'\n icon?: Icon\n showIcon?: boolean\n}\n\ntype SmallSizeProps = BaseProps & {\n size: 'small'\n /** Icons are not supported on the small variant — omit this prop. */\n icon?: never\n showIcon?: never\n}\n\ntype Props = DefaultSizeProps | SmallSizeProps\n\nconst colorToIcon = {\n error: XCircleIcon,\n success: CheckCircleIcon,\n warning: WarningCircleIcon,\n processing: ArrowsClockwiseIcon,\n default: GearIcon,\n}\n\nconst statusToColor = {\n error: 'var(--j2-color-error-text)',\n success: 'var(--j2-color-success)',\n warning: 'var(--j2-color-warning-text)',\n processing: 'var(--j2-color-primary)',\n default: 'var(--j2-color-text)',\n}\n\nexport const Tag = ({\n status,\n showIcon = false,\n icon,\n size = 'default',\n bordered,\n variant,\n ...props\n}: Props) => {\n const iconComponent = React.useMemo(() => {\n if (!showIcon || size === 'small') return null\n\n const baseProps = {\n size: 12,\n }\n\n const iconName: Icon = icon ?? colorToIcon[status]\n const color: string = statusToColor[status]\n\n return (\n <span role=\"img\" className=\"anticon\" aria-label={`${status} icon`}>\n {React.createElement(iconName, { color, ...baseProps })}\n </span>\n )\n }, [status, showIcon, icon])\n\n const statusToClassName: Partial<Record<keyof typeof statusToColor, string>> =\n {\n default: 'bg-[var(--j2-color-fill-quaternary)]',\n }\n\n return (\n <AntdTag\n {...props}\n variant={variant ?? (bordered === false ? 'filled' : 'outlined')}\n color={status}\n icon={iconComponent}\n className={cx(\n 'j2-tag',\n props.className,\n statusToClassName[status],\n size === 'small' && '!px-1 !py-0 !h-auto !text-j2-xs !rounded-j2-sm'\n )}\n />\n )\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Tag.cjs","names":["XCircleIcon","CheckCircleIcon","WarningCircleIcon","ArrowsClockwiseIcon","GearIcon","React","AntdTag","cx"],"sources":["../../../../src/components/tag/Tag.tsx"],"sourcesContent":["import * as React from 'react'\nimport { Tag as AntdTag, TagProps } from 'antd'\nimport {\n ArrowsClockwiseIcon,\n CheckCircleIcon,\n GearIcon,\n Icon,\n WarningCircleIcon,\n XCircleIcon,\n} from '@phosphor-icons/react'\nimport cx from 'classnames'\nimport './Tag.css'\n\ntype BaseProps = Expand<Omit<TagProps, 'icon'>> & {\n status: 'default' | 'error' | 'success' | 'warning' | 'processing'\n}\n\ntype DefaultSizeProps = BaseProps & {\n size?: 'default'\n icon?: Icon\n showIcon?: boolean\n}\n\ntype SmallSizeProps = BaseProps & {\n size: 'small'\n /** Icons are not supported on the small variant — omit this prop. */\n icon?: never\n showIcon?: never\n}\n\ntype Props = DefaultSizeProps | SmallSizeProps\n\nconst colorToIcon = {\n error: XCircleIcon,\n success: CheckCircleIcon,\n warning: WarningCircleIcon,\n processing: ArrowsClockwiseIcon,\n default: GearIcon,\n}\n\nconst statusToColor = {\n error: 'var(--j2-color-error-text)',\n success: 'var(--j2-color-success)',\n warning: 'var(--j2-color-warning-text)',\n processing: 'var(--j2-color-primary)',\n default: 'var(--j2-color-text)',\n}\n\nexport const Tag = ({\n status,\n showIcon = false,\n icon,\n size = 'default',\n bordered,\n variant,\n ...props\n}: Props) => {\n const iconComponent = React.useMemo(() => {\n if (!showIcon || size === 'small') return null\n\n const baseProps = {\n size: 12,\n }\n\n const iconName: Icon = icon ?? colorToIcon[status]\n const color: string = statusToColor[status]\n\n return (\n <span role=\"img\" className=\"anticon\" aria-label={`${status} icon`}>\n {React.createElement(iconName, { color, ...baseProps })}\n </span>\n )\n }, [status, showIcon, icon])\n\n const statusToClassName: Partial<Record<keyof typeof statusToColor, string>> =\n {\n default: 'bg-[var(--j2-color-fill-quaternary)]',\n }\n\n return (\n <AntdTag\n {...props}\n variant={variant ?? (bordered === false ? 'filled' : 'outlined')}\n color={status}\n icon={iconComponent}\n className={cx(\n 'j2-tag',\n props.className,\n statusToClassName[status],\n size === 'small' && '!px-1 !py-0 !h-auto !text-j2-xs !rounded-j2-sm'\n )}\n />\n )\n}\n"],"mappings":";;;;;;;;;;;;AAgCA,IAAM,cAAc;CAClB,OAAOA,sBAAAA;CACP,SAASC,sBAAAA;CACT,SAASC,sBAAAA;CACT,YAAYC,sBAAAA;CACZ,SAASC,sBAAAA;AACX;AAEA,IAAM,gBAAgB;CACpB,OAAO;CACP,SAAS;CACT,SAAS;CACT,YAAY;CACZ,SAAS;AACX;AAEA,IAAa,OAAO,EAClB,QACA,WAAW,OACX,MACA,OAAO,WACP,UACA,SACA,GAAG,YACQ;CACX,MAAM,gBAAgBC,QAAM,cAAc;EACxC,IAAI,CAAC,YAAY,SAAS,SAAS,OAAO;EAE1C,MAAM,YAAY,EAChB,MAAM,GACR;EAEA,MAAM,WAAiB,QAAQ,YAAY;EAC3C,MAAM,QAAgB,cAAc;EAEpC,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;GAAM,MAAK;GAAM,WAAU;GAAU,cAAY,GAAG,OAAO;GACxD,UAAAA,QAAM,cAAc,UAAU;IAAE;IAAO,GAAG;GAAU,CAAC;EAClD,CAAA;CAEV,GAAG;EAAC;EAAQ;EAAU;CAAI,CAAC;CAE3B,MAAM,oBACJ,EACE,SAAS,uCACX;CAEF,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,KAAAA,KAAD;EACE,GAAI;EACJ,SAAS,YAAY,aAAa,QAAQ,WAAW;EACrD,OAAO;EACP,MAAM;EACN,YAAA,GAAWC,WAAAA,QAAAA,CACT,UACA,MAAM,WACN,kBAAkB,SAClB,SAAS,WAAW,gDACtB;CACD,CAAA;AAEL"}
|
package/package.json
CHANGED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
//#region \0rolldown/runtime.js
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __exportAll = (all, no_symbols) => {
|
|
7
|
-
let target = {};
|
|
8
|
-
for (var name in all) __defProp(target, name, {
|
|
9
|
-
get: all[name],
|
|
10
|
-
enumerable: true
|
|
11
|
-
});
|
|
12
|
-
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
13
|
-
return target;
|
|
14
|
-
};
|
|
15
|
-
var __copyProps = (to, from, except, desc) => {
|
|
16
|
-
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
17
|
-
key = keys[i];
|
|
18
|
-
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
19
|
-
get: ((k) => from[k]).bind(null, key),
|
|
20
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
return to;
|
|
24
|
-
};
|
|
25
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
26
|
-
//#endregion
|
|
27
|
-
export { __exportAll, __reExport };
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
const require_runtime = require("../../../_virtual/_rolldown/runtime.cjs");
|
|
2
|
-
//#region src/components/icons/index.tsx
|
|
3
|
-
var icons_exports = /* @__PURE__ */ require_runtime.__exportAll({});
|
|
4
|
-
require_runtime.__reExport(icons_exports, require("@phosphor-icons/react"));
|
|
5
|
-
//#endregion
|
|
6
|
-
Object.defineProperty(exports, "icons_exports", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function() {
|
|
9
|
-
return icons_exports;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
var _phosphor_icons_react = require("@phosphor-icons/react");
|
|
13
|
-
Object.keys(_phosphor_icons_react).forEach(function(k) {
|
|
14
|
-
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
15
|
-
enumerable: true,
|
|
16
|
-
get: function() {
|
|
17
|
-
return _phosphor_icons_react[k];
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":[],"sources":["../../../../src/components/icons/index.tsx"],"sourcesContent":["export * from '@phosphor-icons/react'\n"],"mappings":""}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { __exportAll, __reExport } from "../../../_virtual/_rolldown/runtime.js";
|
|
2
|
-
export * from "@phosphor-icons/react";
|
|
3
|
-
//#region src/components/icons/index.tsx
|
|
4
|
-
var icons_exports = /* @__PURE__ */ __exportAll({});
|
|
5
|
-
import * as import__phosphor_icons_react from "@phosphor-icons/react";
|
|
6
|
-
__reExport(icons_exports, import__phosphor_icons_react);
|
|
7
|
-
//#endregion
|
|
8
|
-
export { icons_exports };
|
|
9
|
-
|
|
10
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/icons/index.tsx"],"sourcesContent":["export * from '@phosphor-icons/react'\n"],"mappings":""}
|