@veeqo/ui 15.21.0 → 15.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Card/Card.cjs +2 -2
- package/dist/components/Card/Card.cjs.map +1 -1
- package/dist/components/Card/Card.d.ts +3 -2
- package/dist/components/Card/Card.js +2 -2
- package/dist/components/Card/Card.js.map +1 -1
- package/dist/components/DataGrid/DataGrid.cjs +2 -2
- package/dist/components/DataGrid/DataGrid.cjs.map +1 -1
- package/dist/components/DataGrid/DataGrid.d.ts +1 -1
- package/dist/components/DataGrid/DataGrid.js +2 -2
- package/dist/components/DataGrid/DataGrid.js.map +1 -1
- package/dist/components/DataGrid/components/GridContainer/GridContainer.cjs +2 -2
- package/dist/components/DataGrid/components/GridContainer/GridContainer.cjs.map +1 -1
- package/dist/components/DataGrid/components/GridContainer/GridContainer.d.ts +3 -2
- package/dist/components/DataGrid/components/GridContainer/GridContainer.js +2 -2
- package/dist/components/DataGrid/components/GridContainer/GridContainer.js.map +1 -1
- package/dist/components/DataGrid/types/DataGridProps.d.ts +2 -1
- package/dist/icons/custom/components/CreditIcon.cjs +7 -7
- package/dist/icons/custom/components/CreditIcon.cjs.map +1 -1
- package/dist/icons/custom/components/CreditIcon.js +7 -7
- package/dist/icons/custom/components/CreditIcon.js.map +1 -1
- package/dist/icons/custom/components/ShipPlusCreditIcon.cjs +30 -0
- package/dist/icons/custom/components/ShipPlusCreditIcon.cjs.map +1 -0
- package/dist/icons/custom/components/ShipPlusCreditIcon.d.ts +3 -0
- package/dist/icons/custom/components/ShipPlusCreditIcon.js +8 -0
- package/dist/icons/custom/components/ShipPlusCreditIcon.js.map +1 -0
- package/dist/icons/custom/index.d.ts +1 -0
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/utils/storybook/pseudoStates.d.ts +40 -0
- package/package.json +16 -9
|
@@ -39,7 +39,7 @@ const Footer = React__default.default.forwardRef(({ className, ...rest }, ref) =
|
|
|
39
39
|
Footer.displayName = 'Card.Footer';
|
|
40
40
|
Footer.toString = () => `.${FOOTER_STABLE_CLASS}`;
|
|
41
41
|
/* --- Main Card component --- */
|
|
42
|
-
const Card = ({ className, style, title, subtitle, headerTitleSlot, headerActionSlot, action, collapsable, elevation, accent, children, onClose, renderFooter, }) => {
|
|
42
|
+
const Card = ({ className, style, title, subtitle, headerTitleSlot, headerActionSlot, action, collapsable, elevation, accent, children, onClose, renderFooter, ...rest }) => {
|
|
43
43
|
const [isCollapsed, setIsCollapsed] = React.useState(false);
|
|
44
44
|
const toggleCollapsed = () => {
|
|
45
45
|
setIsCollapsed(!isCollapsed);
|
|
@@ -50,7 +50,7 @@ const Card = ({ className, style, title, subtitle, headerTitleSlot, headerAction
|
|
|
50
50
|
const bodyMarkup = (React__default.default.createElement(framerMotion.motion.div, { className: Card_module.body, animate: showBody ? 'expanded' : 'collapsed', variants: collapseAnimationVariants, transition: { duration: 0.3, ease: 'easeOut' } },
|
|
51
51
|
React__default.default.createElement(Section, null, children)));
|
|
52
52
|
const footerMarkup = renderFooter !== undefined && React__default.default.createElement(Footer, null, renderFooter());
|
|
53
|
-
return (React__default.default.createElement(Surface, { className: className, style: style, elevation: elevation, accent: accent },
|
|
53
|
+
return (React__default.default.createElement(Surface, { className: className, style: style, elevation: elevation, accent: accent, ...rest },
|
|
54
54
|
headerMarkup,
|
|
55
55
|
bodyMarkup,
|
|
56
56
|
footerMarkup));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.cjs","sources":["../../../src/components/Card/Card.tsx"],"sourcesContent":["import React, { ReactNode, useState } from 'react';\nimport { motion } from 'framer-motion';\n\nimport { CardHeader } from '../CardHeader';\nimport { buildClassnames } from '../../utils';\nimport styles from './Card.module.scss';\n\nexport type CardElevation = 0 | 1 | 2 | 3 | 4;\n\nconst collapseAnimationVariants = {\n expanded: { height: 'auto' },\n collapsed: { height: 0 },\n};\n\ntype CardAction = {\n title: string;\n onClick: () => void;\n};\n\nexport type CardProps = {\n className?: string;\n style?: React.CSSProperties;\n title?: string;\n subtitle?: string;\n headerTitleSlot?: React.ReactNode;\n headerActionSlot?: React.ReactNode;\n action?: CardAction;\n collapsable?: boolean;\n elevation?: CardElevation;\n accent?: 'info' | 'success' | 'error';\n children: ReactNode;\n onClose?: () => void;\n renderFooter?: () => ReactNode;\n};\n\n/* --- Sub-components --- */\n\nexport interface SurfaceProps extends React.HTMLAttributes<HTMLDivElement> {\n elevation?: CardElevation;\n accent?: 'info' | 'success' | 'error';\n children?: ReactNode;\n}\n\n/**\n * Stable class used for styled-components selector interpolation.\n * Consumers (e.g. Modal) use `& > ${Card.Surface}` in template literals,\n * which calls `.toString()` and expects a CSS class selector.\n */\nconst SURFACE_STABLE_CLASS = 'veeqo-card-surface';\n\nconst Surface = React.forwardRef<HTMLDivElement, SurfaceProps>(\n ({ elevation = 1, accent, className, children, ...rest }, ref) => (\n <div\n ref={ref}\n className={buildClassnames([\n SURFACE_STABLE_CLASS,\n styles.surface,\n styles[`elevation-${elevation}`],\n accent ? styles[`accent-${accent}`] : undefined,\n className,\n ])}\n {...rest}\n >\n {children}\n </div>\n ),\n);\nSurface.displayName = 'Card.Surface';\nSurface.toString = () => `.${SURFACE_STABLE_CLASS}`;\n\nconst Section = React.forwardRef<HTMLElement, React.HTMLAttributes<HTMLElement>>(\n ({ className, ...rest }, ref) => (\n <section ref={ref} className={buildClassnames([styles.section, className])} {...rest} />\n ),\n);\nSection.displayName = 'Card.Section';\n\nconst FullBleed = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...rest }, ref) => (\n <div ref={ref} className={buildClassnames([styles.fullBleed, className])} {...rest} />\n ),\n);\nFullBleed.displayName = 'Card.FullBleed';\n\nconst FOOTER_STABLE_CLASS = 'veeqo-card-footer';\n\nconst Footer = React.forwardRef<HTMLElement, React.HTMLAttributes<HTMLElement>>(\n ({ className, ...rest }, ref) => (\n <footer ref={ref} className={buildClassnames([FOOTER_STABLE_CLASS, styles.footer, className])} {...rest} />\n ),\n);\nFooter.displayName = 'Card.Footer';\nFooter.toString = () => `.${FOOTER_STABLE_CLASS}`;\n\n/* --- Main Card component --- */\n\nexport const Card = ({\n className,\n style,\n title,\n subtitle,\n headerTitleSlot,\n headerActionSlot,\n action,\n collapsable,\n elevation,\n accent,\n children,\n onClose,\n renderFooter,\n}: CardProps) => {\n const [isCollapsed, setIsCollapsed] = useState(false);\n\n const toggleCollapsed = () => {\n setIsCollapsed(!isCollapsed);\n };\n\n const showHeader = title || headerTitleSlot !== undefined;\n const headerMarkup = showHeader && (\n <CardHeader\n title={title}\n subtitle={subtitle}\n titleSlot={headerTitleSlot}\n actionSlot={headerActionSlot}\n action={action}\n onClickClose={onClose}\n isCollapsed={isCollapsed}\n onClickCollapse={collapsable ? toggleCollapsed : undefined}\n />\n );\n\n const showBody = (collapsable && !isCollapsed) || !collapsable;\n const bodyMarkup = (\n <motion.div\n className={styles.body}\n animate={showBody ? 'expanded' : 'collapsed'}\n variants={collapseAnimationVariants}\n transition={{ duration: 0.3, ease: 'easeOut' }}\n >\n <Section>{children}</Section>\n </motion.div>\n );\n\n const footerMarkup = renderFooter !== undefined && <Footer>{renderFooter()}</Footer>;\n\n return (\n <Surface className={className} style={style} elevation={elevation} accent={accent}>\n {headerMarkup}\n {bodyMarkup}\n {footerMarkup}\n </Surface>\n );\n};\n\nCard.Surface = Surface;\nCard.Section = Section;\nCard.FullBleed = FullBleed;\nCard.Footer = Footer;\n"],"names":["React","buildClassnames","styles","useState","CardHeader","motion"],"mappings":";;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"Card.cjs","sources":["../../../src/components/Card/Card.tsx"],"sourcesContent":["import React, { ReactNode, useState } from 'react';\nimport { motion } from 'framer-motion';\n\nimport { CardHeader } from '../CardHeader';\nimport { buildClassnames } from '../../utils';\nimport { DataAttributes } from '../types';\nimport styles from './Card.module.scss';\n\nexport type CardElevation = 0 | 1 | 2 | 3 | 4;\n\nconst collapseAnimationVariants = {\n expanded: { height: 'auto' },\n collapsed: { height: 0 },\n};\n\ntype CardAction = {\n title: string;\n onClick: () => void;\n};\n\nexport type CardProps = {\n className?: string;\n style?: React.CSSProperties;\n title?: string;\n subtitle?: string;\n headerTitleSlot?: React.ReactNode;\n headerActionSlot?: React.ReactNode;\n action?: CardAction;\n collapsable?: boolean;\n elevation?: CardElevation;\n accent?: 'info' | 'success' | 'error';\n children: ReactNode;\n onClose?: () => void;\n renderFooter?: () => ReactNode;\n} & DataAttributes;\n\n/* --- Sub-components --- */\n\nexport interface SurfaceProps extends React.HTMLAttributes<HTMLDivElement> {\n elevation?: CardElevation;\n accent?: 'info' | 'success' | 'error';\n children?: ReactNode;\n}\n\n/**\n * Stable class used for styled-components selector interpolation.\n * Consumers (e.g. Modal) use `& > ${Card.Surface}` in template literals,\n * which calls `.toString()` and expects a CSS class selector.\n */\nconst SURFACE_STABLE_CLASS = 'veeqo-card-surface';\n\nconst Surface = React.forwardRef<HTMLDivElement, SurfaceProps>(\n ({ elevation = 1, accent, className, children, ...rest }, ref) => (\n <div\n ref={ref}\n className={buildClassnames([\n SURFACE_STABLE_CLASS,\n styles.surface,\n styles[`elevation-${elevation}`],\n accent ? styles[`accent-${accent}`] : undefined,\n className,\n ])}\n {...rest}\n >\n {children}\n </div>\n ),\n);\nSurface.displayName = 'Card.Surface';\nSurface.toString = () => `.${SURFACE_STABLE_CLASS}`;\n\nconst Section = React.forwardRef<HTMLElement, React.HTMLAttributes<HTMLElement>>(\n ({ className, ...rest }, ref) => (\n <section ref={ref} className={buildClassnames([styles.section, className])} {...rest} />\n ),\n);\nSection.displayName = 'Card.Section';\n\nconst FullBleed = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...rest }, ref) => (\n <div ref={ref} className={buildClassnames([styles.fullBleed, className])} {...rest} />\n ),\n);\nFullBleed.displayName = 'Card.FullBleed';\n\nconst FOOTER_STABLE_CLASS = 'veeqo-card-footer';\n\nconst Footer = React.forwardRef<HTMLElement, React.HTMLAttributes<HTMLElement>>(\n ({ className, ...rest }, ref) => (\n <footer ref={ref} className={buildClassnames([FOOTER_STABLE_CLASS, styles.footer, className])} {...rest} />\n ),\n);\nFooter.displayName = 'Card.Footer';\nFooter.toString = () => `.${FOOTER_STABLE_CLASS}`;\n\n/* --- Main Card component --- */\n\nexport const Card = ({\n className,\n style,\n title,\n subtitle,\n headerTitleSlot,\n headerActionSlot,\n action,\n collapsable,\n elevation,\n accent,\n children,\n onClose,\n renderFooter,\n ...rest\n}: CardProps) => {\n const [isCollapsed, setIsCollapsed] = useState(false);\n\n const toggleCollapsed = () => {\n setIsCollapsed(!isCollapsed);\n };\n\n const showHeader = title || headerTitleSlot !== undefined;\n const headerMarkup = showHeader && (\n <CardHeader\n title={title}\n subtitle={subtitle}\n titleSlot={headerTitleSlot}\n actionSlot={headerActionSlot}\n action={action}\n onClickClose={onClose}\n isCollapsed={isCollapsed}\n onClickCollapse={collapsable ? toggleCollapsed : undefined}\n />\n );\n\n const showBody = (collapsable && !isCollapsed) || !collapsable;\n const bodyMarkup = (\n <motion.div\n className={styles.body}\n animate={showBody ? 'expanded' : 'collapsed'}\n variants={collapseAnimationVariants}\n transition={{ duration: 0.3, ease: 'easeOut' }}\n >\n <Section>{children}</Section>\n </motion.div>\n );\n\n const footerMarkup = renderFooter !== undefined && <Footer>{renderFooter()}</Footer>;\n\n return (\n <Surface className={className} style={style} elevation={elevation} accent={accent} {...rest}>\n {headerMarkup}\n {bodyMarkup}\n {footerMarkup}\n </Surface>\n );\n};\n\nCard.Surface = Surface;\nCard.Section = Section;\nCard.FullBleed = FullBleed;\nCard.Footer = Footer;\n"],"names":["React","buildClassnames","styles","useState","CardHeader","motion"],"mappings":";;;;;;;;;;;;;AAUA,MAAM,yBAAyB,GAAG;AAChC,IAAA,QAAQ,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE;A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string;
|
|
@@ -18,14 +19,14 @@ export type CardProps = {
|
|
|
18
19
|
children: ReactNode;
|
|
19
20
|
onClose?: () => void;
|
|
20
21
|
renderFooter?: () => ReactNode;
|
|
21
|
-
};
|
|
22
|
+
} & DataAttributes;
|
|
22
23
|
export interface SurfaceProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
23
24
|
elevation?: CardElevation;
|
|
24
25
|
accent?: 'info' | 'success' | 'error';
|
|
25
26
|
children?: ReactNode;
|
|
26
27
|
}
|
|
27
28
|
export declare const Card: {
|
|
28
|
-
({ className, style, title, subtitle, headerTitleSlot, headerActionSlot, action, collapsable, elevation, accent, children, onClose, renderFooter, }: CardProps): React.JSX.Element;
|
|
29
|
+
({ className, style, title, subtitle, headerTitleSlot, headerActionSlot, action, collapsable, elevation, accent, children, onClose, renderFooter, ...rest }: CardProps): React.JSX.Element;
|
|
29
30
|
Surface: React.ForwardRefExoticComponent<SurfaceProps & React.RefAttributes<HTMLDivElement>>;
|
|
30
31
|
Section: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLElement> & React.RefAttributes<HTMLElement>>;
|
|
31
32
|
FullBleed: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -33,7 +33,7 @@ const Footer = React__default.forwardRef(({ className, ...rest }, ref) => (React
|
|
|
33
33
|
Footer.displayName = 'Card.Footer';
|
|
34
34
|
Footer.toString = () => `.${FOOTER_STABLE_CLASS}`;
|
|
35
35
|
/* --- Main Card component --- */
|
|
36
|
-
const Card = ({ className, style, title, subtitle, headerTitleSlot, headerActionSlot, action, collapsable, elevation, accent, children, onClose, renderFooter, }) => {
|
|
36
|
+
const Card = ({ className, style, title, subtitle, headerTitleSlot, headerActionSlot, action, collapsable, elevation, accent, children, onClose, renderFooter, ...rest }) => {
|
|
37
37
|
const [isCollapsed, setIsCollapsed] = useState(false);
|
|
38
38
|
const toggleCollapsed = () => {
|
|
39
39
|
setIsCollapsed(!isCollapsed);
|
|
@@ -44,7 +44,7 @@ const Card = ({ className, style, title, subtitle, headerTitleSlot, headerAction
|
|
|
44
44
|
const bodyMarkup = (React__default.createElement(motion.div, { className: styles.body, animate: showBody ? 'expanded' : 'collapsed', variants: collapseAnimationVariants, transition: { duration: 0.3, ease: 'easeOut' } },
|
|
45
45
|
React__default.createElement(Section, null, children)));
|
|
46
46
|
const footerMarkup = renderFooter !== undefined && React__default.createElement(Footer, null, renderFooter());
|
|
47
|
-
return (React__default.createElement(Surface, { className: className, style: style, elevation: elevation, accent: accent },
|
|
47
|
+
return (React__default.createElement(Surface, { className: className, style: style, elevation: elevation, accent: accent, ...rest },
|
|
48
48
|
headerMarkup,
|
|
49
49
|
bodyMarkup,
|
|
50
50
|
footerMarkup));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.js","sources":["../../../src/components/Card/Card.tsx"],"sourcesContent":["import React, { ReactNode, useState } from 'react';\nimport { motion } from 'framer-motion';\n\nimport { CardHeader } from '../CardHeader';\nimport { buildClassnames } from '../../utils';\nimport styles from './Card.module.scss';\n\nexport type CardElevation = 0 | 1 | 2 | 3 | 4;\n\nconst collapseAnimationVariants = {\n expanded: { height: 'auto' },\n collapsed: { height: 0 },\n};\n\ntype CardAction = {\n title: string;\n onClick: () => void;\n};\n\nexport type CardProps = {\n className?: string;\n style?: React.CSSProperties;\n title?: string;\n subtitle?: string;\n headerTitleSlot?: React.ReactNode;\n headerActionSlot?: React.ReactNode;\n action?: CardAction;\n collapsable?: boolean;\n elevation?: CardElevation;\n accent?: 'info' | 'success' | 'error';\n children: ReactNode;\n onClose?: () => void;\n renderFooter?: () => ReactNode;\n};\n\n/* --- Sub-components --- */\n\nexport interface SurfaceProps extends React.HTMLAttributes<HTMLDivElement> {\n elevation?: CardElevation;\n accent?: 'info' | 'success' | 'error';\n children?: ReactNode;\n}\n\n/**\n * Stable class used for styled-components selector interpolation.\n * Consumers (e.g. Modal) use `& > ${Card.Surface}` in template literals,\n * which calls `.toString()` and expects a CSS class selector.\n */\nconst SURFACE_STABLE_CLASS = 'veeqo-card-surface';\n\nconst Surface = React.forwardRef<HTMLDivElement, SurfaceProps>(\n ({ elevation = 1, accent, className, children, ...rest }, ref) => (\n <div\n ref={ref}\n className={buildClassnames([\n SURFACE_STABLE_CLASS,\n styles.surface,\n styles[`elevation-${elevation}`],\n accent ? styles[`accent-${accent}`] : undefined,\n className,\n ])}\n {...rest}\n >\n {children}\n </div>\n ),\n);\nSurface.displayName = 'Card.Surface';\nSurface.toString = () => `.${SURFACE_STABLE_CLASS}`;\n\nconst Section = React.forwardRef<HTMLElement, React.HTMLAttributes<HTMLElement>>(\n ({ className, ...rest }, ref) => (\n <section ref={ref} className={buildClassnames([styles.section, className])} {...rest} />\n ),\n);\nSection.displayName = 'Card.Section';\n\nconst FullBleed = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...rest }, ref) => (\n <div ref={ref} className={buildClassnames([styles.fullBleed, className])} {...rest} />\n ),\n);\nFullBleed.displayName = 'Card.FullBleed';\n\nconst FOOTER_STABLE_CLASS = 'veeqo-card-footer';\n\nconst Footer = React.forwardRef<HTMLElement, React.HTMLAttributes<HTMLElement>>(\n ({ className, ...rest }, ref) => (\n <footer ref={ref} className={buildClassnames([FOOTER_STABLE_CLASS, styles.footer, className])} {...rest} />\n ),\n);\nFooter.displayName = 'Card.Footer';\nFooter.toString = () => `.${FOOTER_STABLE_CLASS}`;\n\n/* --- Main Card component --- */\n\nexport const Card = ({\n className,\n style,\n title,\n subtitle,\n headerTitleSlot,\n headerActionSlot,\n action,\n collapsable,\n elevation,\n accent,\n children,\n onClose,\n renderFooter,\n}: CardProps) => {\n const [isCollapsed, setIsCollapsed] = useState(false);\n\n const toggleCollapsed = () => {\n setIsCollapsed(!isCollapsed);\n };\n\n const showHeader = title || headerTitleSlot !== undefined;\n const headerMarkup = showHeader && (\n <CardHeader\n title={title}\n subtitle={subtitle}\n titleSlot={headerTitleSlot}\n actionSlot={headerActionSlot}\n action={action}\n onClickClose={onClose}\n isCollapsed={isCollapsed}\n onClickCollapse={collapsable ? toggleCollapsed : undefined}\n />\n );\n\n const showBody = (collapsable && !isCollapsed) || !collapsable;\n const bodyMarkup = (\n <motion.div\n className={styles.body}\n animate={showBody ? 'expanded' : 'collapsed'}\n variants={collapseAnimationVariants}\n transition={{ duration: 0.3, ease: 'easeOut' }}\n >\n <Section>{children}</Section>\n </motion.div>\n );\n\n const footerMarkup = renderFooter !== undefined && <Footer>{renderFooter()}</Footer>;\n\n return (\n <Surface className={className} style={style} elevation={elevation} accent={accent}>\n {headerMarkup}\n {bodyMarkup}\n {footerMarkup}\n </Surface>\n );\n};\n\nCard.Surface = Surface;\nCard.Section = Section;\nCard.FullBleed = FullBleed;\nCard.Footer = Footer;\n"],"names":["React"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"Card.js","sources":["../../../src/components/Card/Card.tsx"],"sourcesContent":["import React, { ReactNode, useState } from 'react';\nimport { motion } from 'framer-motion';\n\nimport { CardHeader } from '../CardHeader';\nimport { buildClassnames } from '../../utils';\nimport { DataAttributes } from '../types';\nimport styles from './Card.module.scss';\n\nexport type CardElevation = 0 | 1 | 2 | 3 | 4;\n\nconst collapseAnimationVariants = {\n expanded: { height: 'auto' },\n collapsed: { height: 0 },\n};\n\ntype CardAction = {\n title: string;\n onClick: () => void;\n};\n\nexport type CardProps = {\n className?: string;\n style?: React.CSSProperties;\n title?: string;\n subtitle?: string;\n headerTitleSlot?: React.ReactNode;\n headerActionSlot?: React.ReactNode;\n action?: CardAction;\n collapsable?: boolean;\n elevation?: CardElevation;\n accent?: 'info' | 'success' | 'error';\n children: ReactNode;\n onClose?: () => void;\n renderFooter?: () => ReactNode;\n} & DataAttributes;\n\n/* --- Sub-components --- */\n\nexport interface SurfaceProps extends React.HTMLAttributes<HTMLDivElement> {\n elevation?: CardElevation;\n accent?: 'info' | 'success' | 'error';\n children?: ReactNode;\n}\n\n/**\n * Stable class used for styled-components selector interpolation.\n * Consumers (e.g. Modal) use `& > ${Card.Surface}` in template literals,\n * which calls `.toString()` and expects a CSS class selector.\n */\nconst SURFACE_STABLE_CLASS = 'veeqo-card-surface';\n\nconst Surface = React.forwardRef<HTMLDivElement, SurfaceProps>(\n ({ elevation = 1, accent, className, children, ...rest }, ref) => (\n <div\n ref={ref}\n className={buildClassnames([\n SURFACE_STABLE_CLASS,\n styles.surface,\n styles[`elevation-${elevation}`],\n accent ? styles[`accent-${accent}`] : undefined,\n className,\n ])}\n {...rest}\n >\n {children}\n </div>\n ),\n);\nSurface.displayName = 'Card.Surface';\nSurface.toString = () => `.${SURFACE_STABLE_CLASS}`;\n\nconst Section = React.forwardRef<HTMLElement, React.HTMLAttributes<HTMLElement>>(\n ({ className, ...rest }, ref) => (\n <section ref={ref} className={buildClassnames([styles.section, className])} {...rest} />\n ),\n);\nSection.displayName = 'Card.Section';\n\nconst FullBleed = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...rest }, ref) => (\n <div ref={ref} className={buildClassnames([styles.fullBleed, className])} {...rest} />\n ),\n);\nFullBleed.displayName = 'Card.FullBleed';\n\nconst FOOTER_STABLE_CLASS = 'veeqo-card-footer';\n\nconst Footer = React.forwardRef<HTMLElement, React.HTMLAttributes<HTMLElement>>(\n ({ className, ...rest }, ref) => (\n <footer ref={ref} className={buildClassnames([FOOTER_STABLE_CLASS, styles.footer, className])} {...rest} />\n ),\n);\nFooter.displayName = 'Card.Footer';\nFooter.toString = () => `.${FOOTER_STABLE_CLASS}`;\n\n/* --- Main Card component --- */\n\nexport const Card = ({\n className,\n style,\n title,\n subtitle,\n headerTitleSlot,\n headerActionSlot,\n action,\n collapsable,\n elevation,\n accent,\n children,\n onClose,\n renderFooter,\n ...rest\n}: CardProps) => {\n const [isCollapsed, setIsCollapsed] = useState(false);\n\n const toggleCollapsed = () => {\n setIsCollapsed(!isCollapsed);\n };\n\n const showHeader = title || headerTitleSlot !== undefined;\n const headerMarkup = showHeader && (\n <CardHeader\n title={title}\n subtitle={subtitle}\n titleSlot={headerTitleSlot}\n actionSlot={headerActionSlot}\n action={action}\n onClickClose={onClose}\n isCollapsed={isCollapsed}\n onClickCollapse={collapsable ? toggleCollapsed : undefined}\n />\n );\n\n const showBody = (collapsable && !isCollapsed) || !collapsable;\n const bodyMarkup = (\n <motion.div\n className={styles.body}\n animate={showBody ? 'expanded' : 'collapsed'}\n variants={collapseAnimationVariants}\n transition={{ duration: 0.3, ease: 'easeOut' }}\n >\n <Section>{children}</Section>\n </motion.div>\n );\n\n const footerMarkup = renderFooter !== undefined && <Footer>{renderFooter()}</Footer>;\n\n return (\n <Surface className={className} style={style} elevation={elevation} accent={accent} {...rest}>\n {headerMarkup}\n {bodyMarkup}\n {footerMarkup}\n </Surface>\n );\n};\n\nCard.Surface = Surface;\nCard.Section = Section;\nCard.FullBleed = FullBleed;\nCard.Footer = Footer;\n"],"names":["React"],"mappings":";;;;;;;AAUA,MAAM,yBAAyB,GAAG;AAChC,IAAA,QAAQ,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE;AAC5B,IAAA,SAAS,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE;CACzB;AA+BD;;;;AAIG;AACH,MAAM,oBAAoB,GAAG,oBAAoB;AAEjD,MAAM,OAAO,GAAGA,cAAK,CAAC,UAAU,CAC9B,CAAC,EAAE,SAAS,GAAG,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,GAAG,MAC3DA,cAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EACE,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,eAAe,CAAC;QACzB,oBAAoB;AACpB,QAAA,MAAM,CAAC,OAAO;AACd,QAAA,MAAM,CAAC,CAAA,UAAA,EAAa,SAAS,CAAA,CAAE,CAAC;AAChC,QAAA,MAAM,GAAG,MAAM,CAAC,CAAA,OAAA,EAAU,MAAM,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,EAAE,QAAQ,CAAW,CAClB,CACd;AAED,IAAA,MAAM,YAAY,GAAG,YAAY,KAAK,SAAS,IAAIA,cAAA,CAAA,aAAA,CAAC,MAAM,EAAA,IAAA,EAAE,YAAY,EAAE,CAAU;IAEpF,QACEA,6BAAC,OAAO,EAAA,EAAC,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,KAAM,IAAI,EAAA;QACxF,YAAY;QACZ,UAAU;QACV,YAAY,CACL;AAEd;AAEA,IAAI,CAAC,OAAO,GAAG,OAAO;AACtB,IAAI,CAAC,OAAO,GAAG,OAAO;AACtB,IAAI,CAAC,SAAS,GAAG,SAAS;AAC1B,IAAI,CAAC,MAAM,GAAG,MAAM;;;;"}
|
|
@@ -42,7 +42,7 @@ var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
|
42
42
|
*
|
|
43
43
|
* *Important: This component uses CSS modules, and therefore requires a `<ThemeInjector />` to be present on your page.*
|
|
44
44
|
*/
|
|
45
|
-
const DataGrid = ({ density = 'base', striped = true, borderMode = 'full', resizeMode = 'off', containerStyle, enableKeyboardNavigation = false, columns, hiddenColumns, columnOrdering, pinnedColumns, data, getRowId, rowThemes, sortState, onSortChanged, selectionMode, selectedRows, disabledRows, hideSelectionForRows, onSelectionChanged, rowGrouping, columnWidths, onColumnsResized, isLoading, loadingRowCount, emptyState, emptySlot, id, className, 'aria-label': ariaLabel, }) => {
|
|
45
|
+
const DataGrid = ({ density = 'base', striped = true, borderMode = 'full', resizeMode = 'off', containerStyle, enableKeyboardNavigation = false, columns, hiddenColumns, columnOrdering, pinnedColumns, data, getRowId, rowThemes, sortState, onSortChanged, selectionMode, selectedRows, disabledRows, hideSelectionForRows, onSelectionChanged, rowGrouping, columnWidths, onColumnsResized, isLoading, loadingRowCount, emptyState, emptySlot, id, className, 'aria-label': ariaLabel, ...rest }) => {
|
|
46
46
|
var _a;
|
|
47
47
|
/**
|
|
48
48
|
* Refs to the table and table container. Used for keyboard navigation and drag-to-scroll.
|
|
@@ -168,7 +168,7 @@ const DataGrid = ({ density = 'base', striped = true, borderMode = 'full', resiz
|
|
|
168
168
|
}
|
|
169
169
|
return React__default.default.createElement(Body.Body, { ...bodyProps });
|
|
170
170
|
};
|
|
171
|
-
return (React__default.default.createElement(GridContainer.GridContainer, { containerRef: containerRef, tableRef: tableRef, borderMode: borderMode, containerStyles: { ...containerStyle, ...pinnedColumnLayoutStyles }, ariaRoles: ariaRoles, enableResizeableColumns: enableColumnResizing, density: density, table: table, id: id, className: className, "aria-label": ariaLabel },
|
|
171
|
+
return (React__default.default.createElement(GridContainer.GridContainer, { containerRef: containerRef, tableRef: tableRef, borderMode: borderMode, containerStyles: { ...containerStyle, ...pinnedColumnLayoutStyles }, ariaRoles: ariaRoles, enableResizeableColumns: enableColumnResizing, density: density, table: table, id: id, className: className, "aria-label": ariaLabel, ...rest },
|
|
172
172
|
enableColumnResizing && React__default.default.createElement(Columns.Columns, { table: table }),
|
|
173
173
|
React__default.default.createElement(Header.Header, { table: table }),
|
|
174
174
|
renderBody(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataGrid.cjs","sources":["../../../src/components/DataGrid/DataGrid.tsx"],"sourcesContent":["import React, { useMemo, useRef } from 'react';\nimport { getCoreRowModel, getExpandedRowModel, useReactTable } from '@tanstack/react-table';\n\nimport { useDragToScroll } from '../../hooks';\n\nimport { DataGridProps } from './types';\nimport { getAriaRoles } from './utils';\nimport { GridContainer, Header, Body, Footer, Columns } from './components';\nimport { EmptyBody, LoadingBody, MemoizedBody } from './components/Body';\n\nimport {\n usePinnedColumnLayout,\n useSortingState,\n useKeyboardNavigation,\n useColumnState,\n useExpandedState,\n useColumnWidthState,\n useSelectionState,\n} from './hooks';\n\n/**\n * A DataGrid component which renders data in a two-dimensional format, with columns and rows. Unlike the `DataTable`\n * component, the `DataGrid` supports both flat and hierarchical (tree) data.\n *\n * Under the hood, it uses [TanStack Table](http://tanstack.com/table/) for table management, and aims to replicate functionality\n * available in major third party grid components such as CloudScape's Table component, AgGrid, etc.\n *\n * Supported features include:\n * - Pinning, resizing (incl. smooth resizing), reordering, and hiding of columns\n * - Selection (single and multiple) and disabling of rows.\n * - Rendering of arbitrarily nested data, expanding/collapsing, and custom full-width 'group' rows.\n * - In-built keyboard navigation with arrow keys, and drag to scroll.\n * - Configurable density.\n *\n * *Important: This component uses CSS modules, and therefore requires a `<ThemeInjector />` to be present on your page.*\n */\nexport const DataGrid = ({\n density = 'base',\n striped = true,\n borderMode = 'full',\n resizeMode = 'off',\n containerStyle,\n enableKeyboardNavigation = false,\n\n columns,\n hiddenColumns,\n columnOrdering,\n pinnedColumns,\n\n data,\n getRowId,\n rowThemes,\n\n sortState,\n onSortChanged,\n\n selectionMode,\n selectedRows,\n disabledRows,\n hideSelectionForRows,\n onSelectionChanged,\n\n rowGrouping,\n\n columnWidths,\n onColumnsResized,\n\n isLoading,\n loadingRowCount,\n\n emptyState,\n emptySlot,\n\n id,\n className,\n 'aria-label': ariaLabel,\n}: DataGridProps) => {\n /**\n * Refs to the table and table container. Used for keyboard navigation and drag-to-scroll.\n */\n const containerRef = useRef<HTMLDivElement>(null);\n const tableRef = useRef<HTMLTableElement>(null);\n\n /**\n * Mutable object to track shift key state and last selected row for range selection.\n */\n const rangeSelectionState = useRef({\n lastSelectedRowId: undefined as string | undefined,\n isShiftKeyPressed: false,\n }).current;\n\n const showFooter = useMemo(\n () => !isLoading && columns.some((column) => column.renderFooter),\n [isLoading, columns],\n );\n const ariaRoles = useMemo(\n () => getAriaRoles({ enableKeyboardNavigation, rowGrouping }),\n [enableKeyboardNavigation, rowGrouping],\n );\n const enableColumnResizing = useMemo(() => resizeMode !== 'off', [resizeMode]);\n\n const allDisabledRows = useMemo(() => {\n const unique = new Set(disabledRows || []);\n if (hideSelectionForRows) {\n hideSelectionForRows.forEach((rowId) => unique.add(rowId));\n }\n return Array.from(unique);\n }, [disabledRows, hideSelectionForRows]);\n\n /**\n * Hooks to handle state for selection, sorting, and expanded/collapsed.\n */\n const { enableRowSelection, enableMultiRowSelection, rowSelection, onRowSelectionChange } =\n useSelectionState({\n selectionMode,\n selectedRows,\n disabledRows: allDisabledRows,\n onSelectionChanged,\n });\n\n const {\n enableSorting,\n enableMultiRemove,\n enableSortingRemoval,\n manualSorting,\n sorting,\n onSortingChange,\n } = useSortingState({ columns, sortState, onSortChanged });\n\n const { expanded, onExpandedChange, enableExpanding, getRowCanExpand, getSubRows } =\n useExpandedState(rowGrouping);\n\n const showExpandButton = rowGrouping?.showExpandButton ?? true;\n\n /**\n * Hooks to setup column state, including visibility, ordering, pinning, and width(s).\n */\n const { mappedColumnDefinitions, columnOrder, columnVisibility, columnPinning } = useColumnState({\n columns,\n hiddenColumns,\n columnOrdering,\n pinnedColumns,\n enableRowSelection: !!enableRowSelection,\n });\n\n const { columnSizing, onColumnSizingChange } = useColumnWidthState({\n mappedColumnDefinitions,\n columnWidths,\n onColumnsResized,\n });\n\n /**\n * Setup the TanStack table, including mapped column definitions, row data, and any additional state such as\n * column visibility and ordering.\n */\n const table = useReactTable<any>({\n data,\n columns: mappedColumnDefinitions,\n\n // Column settings\n columnResizeMode: resizeMode === 'off' ? undefined : resizeMode,\n enableColumnResizing,\n onColumnSizingChange,\n\n // Row model\n getRowId,\n getCoreRowModel: getCoreRowModel(),\n\n // Sorting\n enableSorting,\n enableSortingRemoval,\n enableMultiRemove,\n manualSorting,\n onSortingChange,\n\n // Pinning\n enableColumnPinning: columnPinning.left.length + columnPinning.right.length > 0,\n\n // Selection\n enableRowSelection,\n enableMultiRowSelection,\n onRowSelectionChange,\n\n // Row grouping\n getSubRows,\n getRowCanExpand,\n onExpandedChange,\n enableExpanding,\n getExpandedRowModel: enableExpanding ? getExpandedRowModel() : undefined,\n\n // Inject external table state\n state: {\n columnOrder,\n columnVisibility,\n columnPinning,\n sorting,\n rowSelection,\n expanded,\n columnSizing,\n },\n meta: {\n rangeSelectionState,\n showExpandButton,\n hideSelectionForRows,\n },\n });\n\n /**\n * Pinned column layout\n */\n const { pinnedColumnLayoutStyles } = usePinnedColumnLayout({ table });\n\n /**\n * Other hooks\n */\n useDragToScroll({ targetRef: containerRef, ignoreClassName: 'data-grid-column-resizer' });\n useKeyboardNavigation({ tableRef, enableKeyboardNavigation });\n\n const renderBody = () => {\n if (isLoading) {\n return <LoadingBody table={table} loadingRowCount={loadingRowCount ?? 5} striped={striped} />;\n }\n\n if (data.length === 0) {\n return <EmptyBody table={table} emptyState={emptyState} emptySlot={emptySlot} />;\n }\n\n const bodyProps = {\n table,\n ariaRoles,\n striped,\n rowThemes,\n };\n\n if (table.getState().columnSizingInfo.isResizingColumn) {\n return <MemoizedBody {...bodyProps} />;\n }\n\n return <Body {...bodyProps} />;\n };\n\n return (\n <GridContainer\n containerRef={containerRef}\n tableRef={tableRef}\n borderMode={borderMode}\n containerStyles={{ ...containerStyle, ...pinnedColumnLayoutStyles }}\n ariaRoles={ariaRoles}\n enableResizeableColumns={enableColumnResizing}\n density={density}\n table={table}\n id={id}\n className={className}\n aria-label={ariaLabel}\n >\n {/* Columns */}\n {enableColumnResizing && <Columns table={table} />}\n\n {/* Header */}\n <Header table={table} />\n\n {/* Body */}\n {renderBody()}\n\n {/* Footer */}\n {showFooter && <Footer table={table} ariaRoles={ariaRoles} />}\n </GridContainer>\n );\n};\n"],"names":["useRef","useMemo","getAriaRoles","useSelectionState","useSortingState","useExpandedState","useColumnState","useColumnWidthState","useReactTable","getCoreRowModel","getExpandedRowModel","usePinnedColumnLayout","useDragToScroll","useKeyboardNavigation","React","LoadingBody","EmptyBody","MemoizedBody","Body","GridContainer","Columns","Header","Footer"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBA;;;;;;;;;;;;;;;AAeG;AACI,MAAM,QAAQ,GAAG,CAAC,EACvB,OAAO,GAAG,MAAM,EAChB,OAAO,GAAG,IAAI,EACd,UAAU,GAAG,MAAM,EACnB,UAAU,G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AAS,EAAA,CAAI,CAC/C;AAEpB;;;;"}
|
|
1
|
+
{"version":3,"file":"DataGrid.cjs","sources":["../../../src/components/DataGrid/DataGrid.tsx"],"sourcesContent":["import React, { useMemo, useRef } from 'react';\nimport { getCoreRowModel, getExpandedRowModel, useReactTable } from '@tanstack/react-table';\n\nimport { useDragToScroll } from '../../hooks';\n\nimport { DataGridProps } from './types';\nimport { getAriaRoles } from './utils';\nimport { GridContainer, Header, Body, Footer, Columns } from './components';\nimport { EmptyBody, LoadingBody, MemoizedBody } from './components/Body';\n\nimport {\n usePinnedColumnLayout,\n useSortingState,\n useKeyboardNavigation,\n useColumnState,\n useExpandedState,\n useColumnWidthState,\n useSelectionState,\n} from './hooks';\n\n/**\n * A DataGrid component which renders data in a two-dimensional format, with columns and rows. Unlike the `DataTable`\n * component, the `DataGrid` supports both flat and hierarchical (tree) data.\n *\n * Under the hood, it uses [TanStack Table](http://tanstack.com/table/) for table management, and aims to replicate functionality\n * available in major third party grid components such as CloudScape's Table component, AgGrid, etc.\n *\n * Supported features include:\n * - Pinning, resizing (incl. smooth resizing), reordering, and hiding of columns\n * - Selection (single and multiple) and disabling of rows.\n * - Rendering of arbitrarily nested data, expanding/collapsing, and custom full-width 'group' rows.\n * - In-built keyboard navigation with arrow keys, and drag to scroll.\n * - Configurable density.\n *\n * *Important: This component uses CSS modules, and therefore requires a `<ThemeInjector />` to be present on your page.*\n */\nexport const DataGrid = ({\n density = 'base',\n striped = true,\n borderMode = 'full',\n resizeMode = 'off',\n containerStyle,\n enableKeyboardNavigation = false,\n\n columns,\n hiddenColumns,\n columnOrdering,\n pinnedColumns,\n\n data,\n getRowId,\n rowThemes,\n\n sortState,\n onSortChanged,\n\n selectionMode,\n selectedRows,\n disabledRows,\n hideSelectionForRows,\n onSelectionChanged,\n\n rowGrouping,\n\n columnWidths,\n onColumnsResized,\n\n isLoading,\n loadingRowCount,\n\n emptyState,\n emptySlot,\n\n id,\n className,\n 'aria-label': ariaLabel,\n ...rest\n}: DataGridProps) => {\n /**\n * Refs to the table and table container. Used for keyboard navigation and drag-to-scroll.\n */\n const containerRef = useRef<HTMLDivElement>(null);\n const tableRef = useRef<HTMLTableElement>(null);\n\n /**\n * Mutable object to track shift key state and last selected row for range selection.\n */\n const rangeSelectionState = useRef({\n lastSelectedRowId: undefined as string | undefined,\n isShiftKeyPressed: false,\n }).current;\n\n const showFooter = useMemo(\n () => !isLoading && columns.some((column) => column.renderFooter),\n [isLoading, columns],\n );\n const ariaRoles = useMemo(\n () => getAriaRoles({ enableKeyboardNavigation, rowGrouping }),\n [enableKeyboardNavigation, rowGrouping],\n );\n const enableColumnResizing = useMemo(() => resizeMode !== 'off', [resizeMode]);\n\n const allDisabledRows = useMemo(() => {\n const unique = new Set(disabledRows || []);\n if (hideSelectionForRows) {\n hideSelectionForRows.forEach((rowId) => unique.add(rowId));\n }\n return Array.from(unique);\n }, [disabledRows, hideSelectionForRows]);\n\n /**\n * Hooks to handle state for selection, sorting, and expanded/collapsed.\n */\n const { enableRowSelection, enableMultiRowSelection, rowSelection, onRowSelectionChange } =\n useSelectionState({\n selectionMode,\n selectedRows,\n disabledRows: allDisabledRows,\n onSelectionChanged,\n });\n\n const {\n enableSorting,\n enableMultiRemove,\n enableSortingRemoval,\n manualSorting,\n sorting,\n onSortingChange,\n } = useSortingState({ columns, sortState, onSortChanged });\n\n const { expanded, onExpandedChange, enableExpanding, getRowCanExpand, getSubRows } =\n useExpandedState(rowGrouping);\n\n const showExpandButton = rowGrouping?.showExpandButton ?? true;\n\n /**\n * Hooks to setup column state, including visibility, ordering, pinning, and width(s).\n */\n const { mappedColumnDefinitions, columnOrder, columnVisibility, columnPinning } = useColumnState({\n columns,\n hiddenColumns,\n columnOrdering,\n pinnedColumns,\n enableRowSelection: !!enableRowSelection,\n });\n\n const { columnSizing, onColumnSizingChange } = useColumnWidthState({\n mappedColumnDefinitions,\n columnWidths,\n onColumnsResized,\n });\n\n /**\n * Setup the TanStack table, including mapped column definitions, row data, and any additional state such as\n * column visibility and ordering.\n */\n const table = useReactTable<any>({\n data,\n columns: mappedColumnDefinitions,\n\n // Column settings\n columnResizeMode: resizeMode === 'off' ? undefined : resizeMode,\n enableColumnResizing,\n onColumnSizingChange,\n\n // Row model\n getRowId,\n getCoreRowModel: getCoreRowModel(),\n\n // Sorting\n enableSorting,\n enableSortingRemoval,\n enableMultiRemove,\n manualSorting,\n onSortingChange,\n\n // Pinning\n enableColumnPinning: columnPinning.left.length + columnPinning.right.length > 0,\n\n // Selection\n enableRowSelection,\n enableMultiRowSelection,\n onRowSelectionChange,\n\n // Row grouping\n getSubRows,\n getRowCanExpand,\n onExpandedChange,\n enableExpanding,\n getExpandedRowModel: enableExpanding ? getExpandedRowModel() : undefined,\n\n // Inject external table state\n state: {\n columnOrder,\n columnVisibility,\n columnPinning,\n sorting,\n rowSelection,\n expanded,\n columnSizing,\n },\n meta: {\n rangeSelectionState,\n showExpandButton,\n hideSelectionForRows,\n },\n });\n\n /**\n * Pinned column layout\n */\n const { pinnedColumnLayoutStyles } = usePinnedColumnLayout({ table });\n\n /**\n * Other hooks\n */\n useDragToScroll({ targetRef: containerRef, ignoreClassName: 'data-grid-column-resizer' });\n useKeyboardNavigation({ tableRef, enableKeyboardNavigation });\n\n const renderBody = () => {\n if (isLoading) {\n return <LoadingBody table={table} loadingRowCount={loadingRowCount ?? 5} striped={striped} />;\n }\n\n if (data.length === 0) {\n return <EmptyBody table={table} emptyState={emptyState} emptySlot={emptySlot} />;\n }\n\n const bodyProps = {\n table,\n ariaRoles,\n striped,\n rowThemes,\n };\n\n if (table.getState().columnSizingInfo.isResizingColumn) {\n return <MemoizedBody {...bodyProps} />;\n }\n\n return <Body {...bodyProps} />;\n };\n\n return (\n <GridContainer\n containerRef={containerRef}\n tableRef={tableRef}\n borderMode={borderMode}\n containerStyles={{ ...containerStyle, ...pinnedColumnLayoutStyles }}\n ariaRoles={ariaRoles}\n enableResizeableColumns={enableColumnResizing}\n density={density}\n table={table}\n id={id}\n className={className}\n aria-label={ariaLabel}\n {...rest}\n >\n {/* Columns */}\n {enableColumnResizing && <Columns table={table} />}\n\n {/* Header */}\n <Header table={table} />\n\n {/* Body */}\n {renderBody()}\n\n {/* Footer */}\n {showFooter && <Footer table={table} ariaRoles={ariaRoles} />}\n </GridContainer>\n );\n};\n"],"names":["useRef","useMemo","getAriaRoles","useSelectionState","useSortingState","useExpandedState","useColumnState","useColumnWidthState","useReactTable","getCoreRowModel","getExpandedRowModel","usePinnedColumnLayout","useDragToScroll","useKeyboardNavigation","React","LoadingBody","EmptyBody","MemoizedBody","Body","GridContainer","Columns","Header","Footer"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBA;;;;;;;;;;;;;;;AAeG;AACI,MAAM,QAAQ,GAAG,CAAC,EACvB,OAAO,GAAG,MAAM,EAChB,OAAO,GAAG,IAAI,EACd,UAAU,GAAG,MAAM,EACnB,UAAU,GAAG,KAAK,EAClB,cAAc,EACd,wBAAwB,GAAG,KAAK,EAEhC,OAAO,EACP,aAAa,EACb,cAAc,EACd,aAAa,EAEb,IAAI,EACJ,QAAQ,EACR,SAAS,EAET,SAAS,EACT,aAAa,EAEb,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,oBAAoB,EACpB,kBAAkB,EAElB,WAAW,EAEX,YAAY,EACZ,gBAAgB,EAEhB,SAAS,EACT,eAAe,EAEf,UAAU,EACV,SAAS,EAET,EAAE,EACF,SAAS,EACT,YAAY,EAAE,SAAS,EACvB,GAAG,IAAI,EACO,KAAI;;AAClB;;AAEG;AACH,IAAA,MAAM,YAAY,GAAGA,YAAM,CAAiB,IAAI,CAAC;AACjD,IAAA,MAAM,QAAQ,GAAGA,YAAM,CAAmB,IAAI,CAAC;AAE/C;;AAEG;IACH,MAAM,mBAAmB,GAAGA,YAAM,CAAC;AACjC,QAAA,iBAAiB,EAAE,SAA+B;AAClD,QAAA,iBAAiB,EAAE,KAAK;KACzB,CAAC,CAAC,OAAO;AAEV,IAAA,MAAM,U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,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE,UAAU,EACtB,eAAe,EAAE,EAAE,GAAG,cAAc,EAAE,GAAG,wBAAwB,EAAE,EACnE,SAAS,EAAE,SAAS,EACpB,uBAAuB,EAAE,oBAAoB,EAC7C,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,EACZ,EAAE,EAAE,EAAE,EACN,SAAS,EAAE,SAAS,EAAA,YAAA,EACR,SAAS,EAAA,GACjB,IAAI,EAAA;AAGP,QAAA,oBAAoB,IAAIL,sBAAA,CAAA,aAAA,CAACM,eAAO,IAAC,KAAK,EAAE,KAAK,EAAA,CAAI;AAGlD,QAAAN,sBAAA,CAAA,aAAA,CAACO,aAAM,EAAA,EAAC,KAAK,EAAE,KAAK,EAAA,CAAI;AAGvB,QAAA,UAAU,EAAE;AAGZ,QAAA,UAAU,IAAIP,sBAAA,CAAA,aAAA,CAACQ,aAAM,EAAA,EAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAA,CAAI,CAC/C;AAEpB;;;;"}
|
|
@@ -16,4 +16,4 @@ import { DataGridProps } from './types';
|
|
|
16
16
|
*
|
|
17
17
|
* *Important: This component uses CSS modules, and therefore requires a `<ThemeInjector />` to be present on your page.*
|
|
18
18
|
*/
|
|
19
|
-
export declare const DataGrid: ({ density, striped, borderMode, resizeMode, containerStyle, enableKeyboardNavigation, columns, hiddenColumns, columnOrdering, pinnedColumns, data, getRowId, rowThemes, sortState, onSortChanged, selectionMode, selectedRows, disabledRows, hideSelectionForRows, onSelectionChanged, rowGrouping, columnWidths, onColumnsResized, isLoading, loadingRowCount, emptyState, emptySlot, id, className, "aria-label": ariaLabel, }: DataGridProps) => React.JSX.Element;
|
|
19
|
+
export declare const DataGrid: ({ density, striped, borderMode, resizeMode, containerStyle, enableKeyboardNavigation, columns, hiddenColumns, columnOrdering, pinnedColumns, data, getRowId, rowThemes, sortState, onSortChanged, selectionMode, selectedRows, disabledRows, hideSelectionForRows, onSelectionChanged, rowGrouping, columnWidths, onColumnsResized, isLoading, loadingRowCount, emptyState, emptySlot, id, className, "aria-label": ariaLabel, ...rest }: DataGridProps) => React.JSX.Element;
|
|
@@ -36,7 +36,7 @@ import { useExpandedState } from './hooks/useExpandedState.js';
|
|
|
36
36
|
*
|
|
37
37
|
* *Important: This component uses CSS modules, and therefore requires a `<ThemeInjector />` to be present on your page.*
|
|
38
38
|
*/
|
|
39
|
-
const DataGrid = ({ density = 'base', striped = true, borderMode = 'full', resizeMode = 'off', containerStyle, enableKeyboardNavigation = false, columns, hiddenColumns, columnOrdering, pinnedColumns, data, getRowId, rowThemes, sortState, onSortChanged, selectionMode, selectedRows, disabledRows, hideSelectionForRows, onSelectionChanged, rowGrouping, columnWidths, onColumnsResized, isLoading, loadingRowCount, emptyState, emptySlot, id, className, 'aria-label': ariaLabel, }) => {
|
|
39
|
+
const DataGrid = ({ density = 'base', striped = true, borderMode = 'full', resizeMode = 'off', containerStyle, enableKeyboardNavigation = false, columns, hiddenColumns, columnOrdering, pinnedColumns, data, getRowId, rowThemes, sortState, onSortChanged, selectionMode, selectedRows, disabledRows, hideSelectionForRows, onSelectionChanged, rowGrouping, columnWidths, onColumnsResized, isLoading, loadingRowCount, emptyState, emptySlot, id, className, 'aria-label': ariaLabel, ...rest }) => {
|
|
40
40
|
var _a;
|
|
41
41
|
/**
|
|
42
42
|
* Refs to the table and table container. Used for keyboard navigation and drag-to-scroll.
|
|
@@ -162,7 +162,7 @@ const DataGrid = ({ density = 'base', striped = true, borderMode = 'full', resiz
|
|
|
162
162
|
}
|
|
163
163
|
return React__default.createElement(Body, { ...bodyProps });
|
|
164
164
|
};
|
|
165
|
-
return (React__default.createElement(GridContainer, { containerRef: containerRef, tableRef: tableRef, borderMode: borderMode, containerStyles: { ...containerStyle, ...pinnedColumnLayoutStyles }, ariaRoles: ariaRoles, enableResizeableColumns: enableColumnResizing, density: density, table: table, id: id, className: className, "aria-label": ariaLabel },
|
|
165
|
+
return (React__default.createElement(GridContainer, { containerRef: containerRef, tableRef: tableRef, borderMode: borderMode, containerStyles: { ...containerStyle, ...pinnedColumnLayoutStyles }, ariaRoles: ariaRoles, enableResizeableColumns: enableColumnResizing, density: density, table: table, id: id, className: className, "aria-label": ariaLabel, ...rest },
|
|
166
166
|
enableColumnResizing && React__default.createElement(Columns, { table: table }),
|
|
167
167
|
React__default.createElement(Header, { table: table }),
|
|
168
168
|
renderBody(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataGrid.js","sources":["../../../src/components/DataGrid/DataGrid.tsx"],"sourcesContent":["import React, { useMemo, useRef } from 'react';\nimport { getCoreRowModel, getExpandedRowModel, useReactTable } from '@tanstack/react-table';\n\nimport { useDragToScroll } from '../../hooks';\n\nimport { DataGridProps } from './types';\nimport { getAriaRoles } from './utils';\nimport { GridContainer, Header, Body, Footer, Columns } from './components';\nimport { EmptyBody, LoadingBody, MemoizedBody } from './components/Body';\n\nimport {\n usePinnedColumnLayout,\n useSortingState,\n useKeyboardNavigation,\n useColumnState,\n useExpandedState,\n useColumnWidthState,\n useSelectionState,\n} from './hooks';\n\n/**\n * A DataGrid component which renders data in a two-dimensional format, with columns and rows. Unlike the `DataTable`\n * component, the `DataGrid` supports both flat and hierarchical (tree) data.\n *\n * Under the hood, it uses [TanStack Table](http://tanstack.com/table/) for table management, and aims to replicate functionality\n * available in major third party grid components such as CloudScape's Table component, AgGrid, etc.\n *\n * Supported features include:\n * - Pinning, resizing (incl. smooth resizing), reordering, and hiding of columns\n * - Selection (single and multiple) and disabling of rows.\n * - Rendering of arbitrarily nested data, expanding/collapsing, and custom full-width 'group' rows.\n * - In-built keyboard navigation with arrow keys, and drag to scroll.\n * - Configurable density.\n *\n * *Important: This component uses CSS modules, and therefore requires a `<ThemeInjector />` to be present on your page.*\n */\nexport const DataGrid = ({\n density = 'base',\n striped = true,\n borderMode = 'full',\n resizeMode = 'off',\n containerStyle,\n enableKeyboardNavigation = false,\n\n columns,\n hiddenColumns,\n columnOrdering,\n pinnedColumns,\n\n data,\n getRowId,\n rowThemes,\n\n sortState,\n onSortChanged,\n\n selectionMode,\n selectedRows,\n disabledRows,\n hideSelectionForRows,\n onSelectionChanged,\n\n rowGrouping,\n\n columnWidths,\n onColumnsResized,\n\n isLoading,\n loadingRowCount,\n\n emptyState,\n emptySlot,\n\n id,\n className,\n 'aria-label': ariaLabel,\n}: DataGridProps) => {\n /**\n * Refs to the table and table container. Used for keyboard navigation and drag-to-scroll.\n */\n const containerRef = useRef<HTMLDivElement>(null);\n const tableRef = useRef<HTMLTableElement>(null);\n\n /**\n * Mutable object to track shift key state and last selected row for range selection.\n */\n const rangeSelectionState = useRef({\n lastSelectedRowId: undefined as string | undefined,\n isShiftKeyPressed: false,\n }).current;\n\n const showFooter = useMemo(\n () => !isLoading && columns.some((column) => column.renderFooter),\n [isLoading, columns],\n );\n const ariaRoles = useMemo(\n () => getAriaRoles({ enableKeyboardNavigation, rowGrouping }),\n [enableKeyboardNavigation, rowGrouping],\n );\n const enableColumnResizing = useMemo(() => resizeMode !== 'off', [resizeMode]);\n\n const allDisabledRows = useMemo(() => {\n const unique = new Set(disabledRows || []);\n if (hideSelectionForRows) {\n hideSelectionForRows.forEach((rowId) => unique.add(rowId));\n }\n return Array.from(unique);\n }, [disabledRows, hideSelectionForRows]);\n\n /**\n * Hooks to handle state for selection, sorting, and expanded/collapsed.\n */\n const { enableRowSelection, enableMultiRowSelection, rowSelection, onRowSelectionChange } =\n useSelectionState({\n selectionMode,\n selectedRows,\n disabledRows: allDisabledRows,\n onSelectionChanged,\n });\n\n const {\n enableSorting,\n enableMultiRemove,\n enableSortingRemoval,\n manualSorting,\n sorting,\n onSortingChange,\n } = useSortingState({ columns, sortState, onSortChanged });\n\n const { expanded, onExpandedChange, enableExpanding, getRowCanExpand, getSubRows } =\n useExpandedState(rowGrouping);\n\n const showExpandButton = rowGrouping?.showExpandButton ?? true;\n\n /**\n * Hooks to setup column state, including visibility, ordering, pinning, and width(s).\n */\n const { mappedColumnDefinitions, columnOrder, columnVisibility, columnPinning } = useColumnState({\n columns,\n hiddenColumns,\n columnOrdering,\n pinnedColumns,\n enableRowSelection: !!enableRowSelection,\n });\n\n const { columnSizing, onColumnSizingChange } = useColumnWidthState({\n mappedColumnDefinitions,\n columnWidths,\n onColumnsResized,\n });\n\n /**\n * Setup the TanStack table, including mapped column definitions, row data, and any additional state such as\n * column visibility and ordering.\n */\n const table = useReactTable<any>({\n data,\n columns: mappedColumnDefinitions,\n\n // Column settings\n columnResizeMode: resizeMode === 'off' ? undefined : resizeMode,\n enableColumnResizing,\n onColumnSizingChange,\n\n // Row model\n getRowId,\n getCoreRowModel: getCoreRowModel(),\n\n // Sorting\n enableSorting,\n enableSortingRemoval,\n enableMultiRemove,\n manualSorting,\n onSortingChange,\n\n // Pinning\n enableColumnPinning: columnPinning.left.length + columnPinning.right.length > 0,\n\n // Selection\n enableRowSelection,\n enableMultiRowSelection,\n onRowSelectionChange,\n\n // Row grouping\n getSubRows,\n getRowCanExpand,\n onExpandedChange,\n enableExpanding,\n getExpandedRowModel: enableExpanding ? getExpandedRowModel() : undefined,\n\n // Inject external table state\n state: {\n columnOrder,\n columnVisibility,\n columnPinning,\n sorting,\n rowSelection,\n expanded,\n columnSizing,\n },\n meta: {\n rangeSelectionState,\n showExpandButton,\n hideSelectionForRows,\n },\n });\n\n /**\n * Pinned column layout\n */\n const { pinnedColumnLayoutStyles } = usePinnedColumnLayout({ table });\n\n /**\n * Other hooks\n */\n useDragToScroll({ targetRef: containerRef, ignoreClassName: 'data-grid-column-resizer' });\n useKeyboardNavigation({ tableRef, enableKeyboardNavigation });\n\n const renderBody = () => {\n if (isLoading) {\n return <LoadingBody table={table} loadingRowCount={loadingRowCount ?? 5} striped={striped} />;\n }\n\n if (data.length === 0) {\n return <EmptyBody table={table} emptyState={emptyState} emptySlot={emptySlot} />;\n }\n\n const bodyProps = {\n table,\n ariaRoles,\n striped,\n rowThemes,\n };\n\n if (table.getState().columnSizingInfo.isResizingColumn) {\n return <MemoizedBody {...bodyProps} />;\n }\n\n return <Body {...bodyProps} />;\n };\n\n return (\n <GridContainer\n containerRef={containerRef}\n tableRef={tableRef}\n borderMode={borderMode}\n containerStyles={{ ...containerStyle, ...pinnedColumnLayoutStyles }}\n ariaRoles={ariaRoles}\n enableResizeableColumns={enableColumnResizing}\n density={density}\n table={table}\n id={id}\n className={className}\n aria-label={ariaLabel}\n >\n {/* Columns */}\n {enableColumnResizing && <Columns table={table} />}\n\n {/* Header */}\n <Header table={table} />\n\n {/* Body */}\n {renderBody()}\n\n {/* Footer */}\n {showFooter && <Footer table={table} ariaRoles={ariaRoles} />}\n </GridContainer>\n );\n};\n"],"names":["React"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAoBA;;;;;;;;;;;;;;;AAeG;AACI,MAAM,QAAQ,GAAG,CAAC,EACvB,OAAO,GAAG,MAAM,EAChB,OAAO,GAAG,IAAI,EACd,UAAU,GAAG,MAAM,EACnB,UAAU,GAAG,KAAK,EAClB,cAAc,EACd,wBAAwB,GAAG,KAAK,EAEhC,OAAO,EACP,aAAa,EACb,cAAc,EACd,aAAa,EAEb,IAAI,EACJ,QAAQ,EACR,SAAS,EAET,SAAS,EACT,aAAa,EAEb,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,oBAAoB,EACpB,kBAAkB,EAElB,WAAW,EAEX,YAAY,EACZ,gBAAgB,EAEhB,SAAS,EACT,eAAe,EAEf,UAAU,EACV,SAAS,EAET,EAAE,EACF,SAAS,EACT,YAAY,EAAE,SAAS,GACT,KAAI;;AAClB;;AAEG;AACH,IAAA,MAAM,YAAY,GAAG,MAAM,CAAiB,IAAI,CAAC;AACjD,IAAA,MAAM,QAAQ,GAAG,MAAM,CAAmB,IAAI,CAAC;AAE/C;;AAEG;IACH,MAAM,mBAAmB,GAAG,MAAM,CAAC;AACjC,QAAA,iBAAiB,EAAE,SAA+B;AAClD,QAAA,iBAAiB,EAAE,KAAK;KACzB,CAAC,CAAC,O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U,EAAE,UAAU,EACtB,eAAe,EAAE,EAAE,GAAG,cAAc,EAAE,GAAG,wBAAwB,EAAE,EACnE,SAAS,EAAE,SAAS,EACpB,uBAAuB,EAAE,oBAAoB,EAC7C,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,EACZ,EAAE,EAAE,EAAE,EACN,SAAS,EAAE,SAAS,EAAA,YAAA,EACR,SAAS,EAAA;AAGpB,QAAA,oBAAoB,IAAIA,cAAA,CAAA,aAAA,CAAC,OAAO,IAAC,KAAK,EAAE,KAAK,EAAA,CAAI;AAGlD,QAAAA,cAAA,CAAA,aAAA,CAAC,MAAM,EAAA,EAAC,KAAK,EAAE,KAAK,EAAA,CAAI;AAGvB,QAAA,UAAU,EAAE;AAGZ,QAAA,UAAU,IAAIA,cAAA,CAAA,aAAA,CAAC,MAAM,EAAA,EAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAA,CAAI,CAC/C;AAEpB;;;;"}
|
|
1
|
+
{"version":3,"file":"DataGrid.js","sources":["../../../src/components/DataGrid/DataGrid.tsx"],"sourcesContent":["import React, { useMemo, useRef } from 'react';\nimport { getCoreRowModel, getExpandedRowModel, useReactTable } from '@tanstack/react-table';\n\nimport { useDragToScroll } from '../../hooks';\n\nimport { DataGridProps } from './types';\nimport { getAriaRoles } from './utils';\nimport { GridContainer, Header, Body, Footer, Columns } from './components';\nimport { EmptyBody, LoadingBody, MemoizedBody } from './components/Body';\n\nimport {\n usePinnedColumnLayout,\n useSortingState,\n useKeyboardNavigation,\n useColumnState,\n useExpandedState,\n useColumnWidthState,\n useSelectionState,\n} from './hooks';\n\n/**\n * A DataGrid component which renders data in a two-dimensional format, with columns and rows. Unlike the `DataTable`\n * component, the `DataGrid` supports both flat and hierarchical (tree) data.\n *\n * Under the hood, it uses [TanStack Table](http://tanstack.com/table/) for table management, and aims to replicate functionality\n * available in major third party grid components such as CloudScape's Table component, AgGrid, etc.\n *\n * Supported features include:\n * - Pinning, resizing (incl. smooth resizing), reordering, and hiding of columns\n * - Selection (single and multiple) and disabling of rows.\n * - Rendering of arbitrarily nested data, expanding/collapsing, and custom full-width 'group' rows.\n * - In-built keyboard navigation with arrow keys, and drag to scroll.\n * - Configurable density.\n *\n * *Important: This component uses CSS modules, and therefore requires a `<ThemeInjector />` to be present on your page.*\n */\nexport const DataGrid = ({\n density = 'base',\n striped = true,\n borderMode = 'full',\n resizeMode = 'off',\n containerStyle,\n enableKeyboardNavigation = false,\n\n columns,\n hiddenColumns,\n columnOrdering,\n pinnedColumns,\n\n data,\n getRowId,\n rowThemes,\n\n sortState,\n onSortChanged,\n\n selectionMode,\n selectedRows,\n disabledRows,\n hideSelectionForRows,\n onSelectionChanged,\n\n rowGrouping,\n\n columnWidths,\n onColumnsResized,\n\n isLoading,\n loadingRowCount,\n\n emptyState,\n emptySlot,\n\n id,\n className,\n 'aria-label': ariaLabel,\n ...rest\n}: DataGridProps) => {\n /**\n * Refs to the table and table container. Used for keyboard navigation and drag-to-scroll.\n */\n const containerRef = useRef<HTMLDivElement>(null);\n const tableRef = useRef<HTMLTableElement>(null);\n\n /**\n * Mutable object to track shift key state and last selected row for range selection.\n */\n const rangeSelectionState = useRef({\n lastSelectedRowId: undefined as string | undefined,\n isShiftKeyPressed: false,\n }).current;\n\n const showFooter = useMemo(\n () => !isLoading && columns.some((column) => column.renderFooter),\n [isLoading, columns],\n );\n const ariaRoles = useMemo(\n () => getAriaRoles({ enableKeyboardNavigation, rowGrouping }),\n [enableKeyboardNavigation, rowGrouping],\n );\n const enableColumnResizing = useMemo(() => resizeMode !== 'off', [resizeMode]);\n\n const allDisabledRows = useMemo(() => {\n const unique = new Set(disabledRows || []);\n if (hideSelectionForRows) {\n hideSelectionForRows.forEach((rowId) => unique.add(rowId));\n }\n return Array.from(unique);\n }, [disabledRows, hideSelectionForRows]);\n\n /**\n * Hooks to handle state for selection, sorting, and expanded/collapsed.\n */\n const { enableRowSelection, enableMultiRowSelection, rowSelection, onRowSelectionChange } =\n useSelectionState({\n selectionMode,\n selectedRows,\n disabledRows: allDisabledRows,\n onSelectionChanged,\n });\n\n const {\n enableSorting,\n enableMultiRemove,\n enableSortingRemoval,\n manualSorting,\n sorting,\n onSortingChange,\n } = useSortingState({ columns, sortState, onSortChanged });\n\n const { expanded, onExpandedChange, enableExpanding, getRowCanExpand, getSubRows } =\n useExpandedState(rowGrouping);\n\n const showExpandButton = rowGrouping?.showExpandButton ?? true;\n\n /**\n * Hooks to setup column state, including visibility, ordering, pinning, and width(s).\n */\n const { mappedColumnDefinitions, columnOrder, columnVisibility, columnPinning } = useColumnState({\n columns,\n hiddenColumns,\n columnOrdering,\n pinnedColumns,\n enableRowSelection: !!enableRowSelection,\n });\n\n const { columnSizing, onColumnSizingChange } = useColumnWidthState({\n mappedColumnDefinitions,\n columnWidths,\n onColumnsResized,\n });\n\n /**\n * Setup the TanStack table, including mapped column definitions, row data, and any additional state such as\n * column visibility and ordering.\n */\n const table = useReactTable<any>({\n data,\n columns: mappedColumnDefinitions,\n\n // Column settings\n columnResizeMode: resizeMode === 'off' ? undefined : resizeMode,\n enableColumnResizing,\n onColumnSizingChange,\n\n // Row model\n getRowId,\n getCoreRowModel: getCoreRowModel(),\n\n // Sorting\n enableSorting,\n enableSortingRemoval,\n enableMultiRemove,\n manualSorting,\n onSortingChange,\n\n // Pinning\n enableColumnPinning: columnPinning.left.length + columnPinning.right.length > 0,\n\n // Selection\n enableRowSelection,\n enableMultiRowSelection,\n onRowSelectionChange,\n\n // Row grouping\n getSubRows,\n getRowCanExpand,\n onExpandedChange,\n enableExpanding,\n getExpandedRowModel: enableExpanding ? getExpandedRowModel() : undefined,\n\n // Inject external table state\n state: {\n columnOrder,\n columnVisibility,\n columnPinning,\n sorting,\n rowSelection,\n expanded,\n columnSizing,\n },\n meta: {\n rangeSelectionState,\n showExpandButton,\n hideSelectionForRows,\n },\n });\n\n /**\n * Pinned column layout\n */\n const { pinnedColumnLayoutStyles } = usePinnedColumnLayout({ table });\n\n /**\n * Other hooks\n */\n useDragToScroll({ targetRef: containerRef, ignoreClassName: 'data-grid-column-resizer' });\n useKeyboardNavigation({ tableRef, enableKeyboardNavigation });\n\n const renderBody = () => {\n if (isLoading) {\n return <LoadingBody table={table} loadingRowCount={loadingRowCount ?? 5} striped={striped} />;\n }\n\n if (data.length === 0) {\n return <EmptyBody table={table} emptyState={emptyState} emptySlot={emptySlot} />;\n }\n\n const bodyProps = {\n table,\n ariaRoles,\n striped,\n rowThemes,\n };\n\n if (table.getState().columnSizingInfo.isResizingColumn) {\n return <MemoizedBody {...bodyProps} />;\n }\n\n return <Body {...bodyProps} />;\n };\n\n return (\n <GridContainer\n containerRef={containerRef}\n tableRef={tableRef}\n borderMode={borderMode}\n containerStyles={{ ...containerStyle, ...pinnedColumnLayoutStyles }}\n ariaRoles={ariaRoles}\n enableResizeableColumns={enableColumnResizing}\n density={density}\n table={table}\n id={id}\n className={className}\n aria-label={ariaLabel}\n {...rest}\n >\n {/* Columns */}\n {enableColumnResizing && <Columns table={table} />}\n\n {/* Header */}\n <Header table={table} />\n\n {/* Body */}\n {renderBody()}\n\n {/* Footer */}\n {showFooter && <Footer table={table} ariaRoles={ariaRoles} />}\n </GridContainer>\n );\n};\n"],"names":["React"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAoBA;;;;;;;;;;;;;;;AAeG;AACI,MAAM,QAAQ,GAAG,CAAC,EACvB,OAAO,GAAG,MAAM,EAChB,OAAO,GAAG,IAAI,EACd,UAAU,GAAG,MAAM,EACnB,UAAU,GAAG,KAAK,EAClB,cAAc,EACd,wBAAwB,GAAG,KAAK,EAEhC,OAAO,EACP,aAAa,EACb,cAAc,EACd,aAAa,EAEb,IAAI,EACJ,QAAQ,EACR,SAAS,EAET,SAAS,EACT,aAAa,EAEb,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,oBAAoB,EACpB,kBAAkB,EAElB,WAAW,EAEX,YAAY,EACZ,gBAAgB,EAEhB,SAAS,EACT,eAAe,EAEf,UA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QAED,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAC,gBAAgB,CAAC,gBAAgB,EAAE;AACtD,YAAA,OAAOA,cAAA,CAAA,aAAA,CAAC,YAAY,EAAA,EAAA,GAAK,SAAS,GAAI;AACvC,QAAA;AAED,QAAA,OAAOA,cAAA,CAAA,aAAA,CAAC,IAAI,EAAA,EAAA,GAAK,SAAS,GAAI;AAChC,IAAA,CAAC;IAED,QACEA,cAAA,CAAA,aAAA,CAAC,aAAa,EAAA,EACZ,YAAY,EAAE,YAAY,EAC1B,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE,UAAU,EACtB,eAAe,EAAE,EAAE,GAAG,cAAc,EAAE,GAAG,wBAAwB,EAAE,EACnE,SAAS,EAAE,SAAS,EACpB,uBAAuB,EAAE,oBAAoB,EAC7C,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,EACZ,EAAE,EAAE,EAAE,EACN,SAAS,EAAE,SAAS,EAAA,YAAA,EACR,SAAS,EAAA,GACjB,IAAI,EAAA;AAGP,QAAA,oBAAoB,IAAIA,cAAA,CAAA,aAAA,CAAC,OAAO,IAAC,KAAK,EAAE,KAAK,EAAA,CAAI;AAGlD,QAAAA,cAAA,CAAA,aAAA,CAAC,MAAM,EAAA,EAAC,KAAK,EAAE,KAAK,EAAA,CAAI;AAGvB,QAAA,UAAU,EAAE;AAGZ,QAAA,UAAU,IAAIA,cAAA,CAAA,aAAA,CAAC,MAAM,EAAA,EAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAA,CAAI,CAC/C;AAEpB;;;;"}
|
|
@@ -29,7 +29,7 @@ const gridContainerClassname = buildClassnames.buildClassnames([GridContainer_mo
|
|
|
29
29
|
* The Grid container, which includes a wrapper and the table element itself. Controls table layout, applies
|
|
30
30
|
* styling and sets table-specific CSS variables (such as density).
|
|
31
31
|
*/
|
|
32
|
-
const GridContainer = ({ containerRef, tableRef, borderMode, containerStyles, ariaRoles, enableResizeableColumns, density, table, children, id, className, 'aria-label': ariaLabel, }) => {
|
|
32
|
+
const GridContainer = ({ containerRef, tableRef, borderMode, containerStyles, ariaRoles, enableResizeableColumns, density, table, children, id, className, 'aria-label': ariaLabel, ...rest }) => {
|
|
33
33
|
const { pinnedColumnLayoutStyles } = usePinnedColumnLayout.usePinnedColumnLayout({ table });
|
|
34
34
|
const { scrollPosition, onScroll, enableTransition } = useScrollPosition.useScrollPosition({ containerRef });
|
|
35
35
|
// CSS variables to control pinned column shadow visibility
|
|
@@ -40,7 +40,7 @@ const GridContainer = ({ containerRef, tableRef, borderMode, containerStyles, ar
|
|
|
40
40
|
'--pinned-shadow-transition-duration': enableTransition ? '0.3s' : '0s',
|
|
41
41
|
};
|
|
42
42
|
return (React__default.default.createElement(Container.Container, { ref: containerRef, borderMode: borderMode, style: containerStyles, onScroll: onScroll },
|
|
43
|
-
React__default.default.createElement("table", { id: id, ref: tableRef, className: buildClassnames.buildClassnames([gridContainerClassname, className]), role: ariaRoles.table, style: {
|
|
43
|
+
React__default.default.createElement("table", { ...rest, id: id, ref: tableRef, className: buildClassnames.buildClassnames([gridContainerClassname, className]), role: ariaRoles.table, style: {
|
|
44
44
|
tableLayout: enableResizeableColumns ? 'fixed' : 'auto',
|
|
45
45
|
'--density': index.theme.sizes[density],
|
|
46
46
|
...pinnedColumnLayoutStyles,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GridContainer.cjs","sources":["../../../../../src/components/DataGrid/components/GridContainer/GridContainer.tsx"],"sourcesContent":["import React, { RefObject, CSSProperties, ReactNode, AriaAttributes } from 'react';\nimport { Table } from '@tanstack/react-table';\n\nimport { theme } from 'Theme';\nimport { SizeScale } from 'Theme/modules/sizes';\n\nimport { useScrollPosition } from '../../../../hooks';\nimport { BorderMode } from '../../types/enums';\nimport { AriaRoles } from '../../types';\nimport { buildClassnames } from '../../../../utils/buildClassnames';\n\nimport { Container } from './Container';\n\nimport styles from './GridContainer.module.scss';\nimport { usePinnedColumnLayout } from '../../hooks';\n\ntype GridContainerProps = Pick<AriaAttributes, 'aria-label'> &\n Pick<React.HTMLAttributes<HTMLTableElement>, 'id' | 'className'> & {\n /**\n * Reference to be used for the outer container element.\n */\n containerRef?: RefObject<HTMLDivElement | null>;\n\n /**\n * Reference to be used for the table element.\n */\n tableRef?: RefObject<HTMLTableElement | null>;\n\n /**\n * Border mode.\n */\n borderMode: BorderMode;\n\n /**\n * Additional container styles.\n */\n containerStyles?: CSSProperties;\n\n /**\n * ARIA roles used in the grid.\n */\n ariaRoles: AriaRoles;\n\n /**\n * Whether resizeable columns are enabled or not.\n */\n enableResizeableColumns: boolean;\n\n /**\n * Density of the grid.\n */\n density: keyof SizeScale;\n\n /**\n * The TanStack Table instance.\n */\n table: Table<any>;\n\n /**\n * Child elements (table contents).\n */\n children: ReactNode;\n };\n\nconst gridContainerClassname = buildClassnames([styles.dataGridStyle, 'data-grid']);\n\n/**\n * The Grid container, which includes a wrapper and the table element itself. Controls table layout, applies\n * styling and sets table-specific CSS variables (such as density).\n */\nexport const GridContainer = ({\n containerRef,\n tableRef,\n borderMode,\n containerStyles,\n ariaRoles,\n enableResizeableColumns,\n density,\n table,\n children,\n id,\n className,\n 'aria-label': ariaLabel,\n}: GridContainerProps) => {\n const { pinnedColumnLayoutStyles } = usePinnedColumnLayout({ table });\n const { scrollPosition, onScroll, enableTransition } = useScrollPosition({ containerRef });\n\n // CSS variables to control pinned column shadow visibility\n const hideShadows = !scrollPosition || scrollPosition === 'none';\n const shadowVisibility = {\n '--pinned-left-shadow-opacity': hideShadows || scrollPosition === 'start' ? 0 : 1,\n '--pinned-right-shadow-opacity': hideShadows || scrollPosition === 'end' ? 0 : 1,\n '--pinned-shadow-transition-duration': enableTransition ? '0.3s' : '0s',\n };\n\n return (\n <Container\n ref={containerRef}\n borderMode={borderMode}\n style={containerStyles}\n onScroll={onScroll}\n >\n <table\n id={id}\n ref={tableRef}\n className={buildClassnames([gridContainerClassname, className])}\n role={ariaRoles.table}\n style={\n {\n tableLayout: enableResizeableColumns ? 'fixed' : 'auto',\n '--density': theme.sizes[density],\n ...pinnedColumnLayoutStyles,\n ...shadowVisibility,\n } as CSSProperties\n }\n aria-colcount={table.getFlatHeaders().length}\n aria-rowcount={table.getRowCount()}\n aria-label={ariaLabel}\n >\n {children}\n </table>\n </Container>\n );\n};\n"],"names":["buildClassnames","styles","usePinnedColumnLayout","useScrollPosition","React","Container","theme"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"GridContainer.cjs","sources":["../../../../../src/components/DataGrid/components/GridContainer/GridContainer.tsx"],"sourcesContent":["import React, { RefObject, CSSProperties, ReactNode, AriaAttributes } from 'react';\nimport { Table } from '@tanstack/react-table';\n\nimport { theme } from 'Theme';\nimport { SizeScale } from 'Theme/modules/sizes';\n\nimport { useScrollPosition } from '../../../../hooks';\nimport { BorderMode } from '../../types/enums';\nimport { AriaRoles } from '../../types';\nimport { DataAttributes } from '../../../types';\nimport { buildClassnames } from '../../../../utils/buildClassnames';\n\nimport { Container } from './Container';\n\nimport styles from './GridContainer.module.scss';\nimport { usePinnedColumnLayout } from '../../hooks';\n\ntype GridContainerProps = Pick<AriaAttributes, 'aria-label'> &\n Pick<React.HTMLAttributes<HTMLTableElement>, 'id' | 'className'> &\n DataAttributes & {\n /**\n * Reference to be used for the outer container element.\n */\n containerRef?: RefObject<HTMLDivElement | null>;\n\n /**\n * Reference to be used for the table element.\n */\n tableRef?: RefObject<HTMLTableElement | null>;\n\n /**\n * Border mode.\n */\n borderMode: BorderMode;\n\n /**\n * Additional container styles.\n */\n containerStyles?: CSSProperties;\n\n /**\n * ARIA roles used in the grid.\n */\n ariaRoles: AriaRoles;\n\n /**\n * Whether resizeable columns are enabled or not.\n */\n enableResizeableColumns: boolean;\n\n /**\n * Density of the grid.\n */\n density: keyof SizeScale;\n\n /**\n * The TanStack Table instance.\n */\n table: Table<any>;\n\n /**\n * Child elements (table contents).\n */\n children: ReactNode;\n };\n\nconst gridContainerClassname = buildClassnames([styles.dataGridStyle, 'data-grid']);\n\n/**\n * The Grid container, which includes a wrapper and the table element itself. Controls table layout, applies\n * styling and sets table-specific CSS variables (such as density).\n */\nexport const GridContainer = ({\n containerRef,\n tableRef,\n borderMode,\n containerStyles,\n ariaRoles,\n enableResizeableColumns,\n density,\n table,\n children,\n id,\n className,\n 'aria-label': ariaLabel,\n ...rest\n}: GridContainerProps) => {\n const { pinnedColumnLayoutStyles } = usePinnedColumnLayout({ table });\n const { scrollPosition, onScroll, enableTransition } = useScrollPosition({ containerRef });\n\n // CSS variables to control pinned column shadow visibility\n const hideShadows = !scrollPosition || scrollPosition === 'none';\n const shadowVisibility = {\n '--pinned-left-shadow-opacity': hideShadows || scrollPosition === 'start' ? 0 : 1,\n '--pinned-right-shadow-opacity': hideShadows || scrollPosition === 'end' ? 0 : 1,\n '--pinned-shadow-transition-duration': enableTransition ? '0.3s' : '0s',\n };\n\n return (\n <Container\n ref={containerRef}\n borderMode={borderMode}\n style={containerStyles}\n onScroll={onScroll}\n >\n <table\n {...rest}\n id={id}\n ref={tableRef}\n className={buildClassnames([gridContainerClassname, className])}\n role={ariaRoles.table}\n style={\n {\n tableLayout: enableResizeableColumns ? 'fixed' : 'auto',\n '--density': theme.sizes[density],\n ...pinnedColumnLayoutStyles,\n ...shadowVisibility,\n } as CSSProperties\n }\n aria-colcount={table.getFlatHeaders().length}\n aria-rowcount={table.getRowCount()}\n aria-label={ariaLabel}\n >\n {children}\n </table>\n </Container>\n );\n};\n"],"names":["buildClassnames","styles","usePinnedColumnLayout","useScrollPosition","React","Container","theme"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAkEA,MAAM,sBAAsB,GAAGA,+BAAe,CAAC,CAACC,oBAAM,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC;AAEnF;;;AAGG;AACI,MAAM,aAAa,GAAG,CAAC,EAC5B,YAAY,EACZ,QAAQ,EACR,UAAU,EACV,eAAe,EACf,SAAS,EAC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AAE,CAAC,MAAM,mBAC7B,KAAK,CAAC,WAAW,EAAE,gBACtB,SAAS,EAAA,EAEpB,QAAQ,CACH,CACE;AAEhB;;;;"}
|
|
@@ -3,7 +3,8 @@ import { Table } from '@tanstack/react-table';
|
|
|
3
3
|
import { SizeScale } from 'Theme/modules/sizes';
|
|
4
4
|
import { BorderMode } from '../../types/enums';
|
|
5
5
|
import { AriaRoles } from '../../types';
|
|
6
|
-
|
|
6
|
+
import { DataAttributes } from '../../../types';
|
|
7
|
+
type GridContainerProps = Pick<AriaAttributes, 'aria-label'> & Pick<React.HTMLAttributes<HTMLTableElement>, 'id' | 'className'> & DataAttributes & {
|
|
7
8
|
/**
|
|
8
9
|
* Reference to be used for the outer container element.
|
|
9
10
|
*/
|
|
@@ -45,5 +46,5 @@ type GridContainerProps = Pick<AriaAttributes, 'aria-label'> & Pick<React.HTMLAt
|
|
|
45
46
|
* The Grid container, which includes a wrapper and the table element itself. Controls table layout, applies
|
|
46
47
|
* styling and sets table-specific CSS variables (such as density).
|
|
47
48
|
*/
|
|
48
|
-
export declare const GridContainer: ({ containerRef, tableRef, borderMode, containerStyles, ariaRoles, enableResizeableColumns, density, table, children, id, className, "aria-label": ariaLabel, }: GridContainerProps) => React.JSX.Element;
|
|
49
|
+
export declare const GridContainer: ({ containerRef, tableRef, borderMode, containerStyles, ariaRoles, enableResizeableColumns, density, table, children, id, className, "aria-label": ariaLabel, ...rest }: GridContainerProps) => React.JSX.Element;
|
|
49
50
|
export {};
|
|
@@ -23,7 +23,7 @@ const gridContainerClassname = buildClassnames([styles.dataGridStyle, 'data-grid
|
|
|
23
23
|
* The Grid container, which includes a wrapper and the table element itself. Controls table layout, applies
|
|
24
24
|
* styling and sets table-specific CSS variables (such as density).
|
|
25
25
|
*/
|
|
26
|
-
const GridContainer = ({ containerRef, tableRef, borderMode, containerStyles, ariaRoles, enableResizeableColumns, density, table, children, id, className, 'aria-label': ariaLabel, }) => {
|
|
26
|
+
const GridContainer = ({ containerRef, tableRef, borderMode, containerStyles, ariaRoles, enableResizeableColumns, density, table, children, id, className, 'aria-label': ariaLabel, ...rest }) => {
|
|
27
27
|
const { pinnedColumnLayoutStyles } = usePinnedColumnLayout({ table });
|
|
28
28
|
const { scrollPosition, onScroll, enableTransition } = useScrollPosition({ containerRef });
|
|
29
29
|
// CSS variables to control pinned column shadow visibility
|
|
@@ -34,7 +34,7 @@ const GridContainer = ({ containerRef, tableRef, borderMode, containerStyles, ar
|
|
|
34
34
|
'--pinned-shadow-transition-duration': enableTransition ? '0.3s' : '0s',
|
|
35
35
|
};
|
|
36
36
|
return (React__default.createElement(Container, { ref: containerRef, borderMode: borderMode, style: containerStyles, onScroll: onScroll },
|
|
37
|
-
React__default.createElement("table", { id: id, ref: tableRef, className: buildClassnames([gridContainerClassname, className]), role: ariaRoles.table, style: {
|
|
37
|
+
React__default.createElement("table", { ...rest, id: id, ref: tableRef, className: buildClassnames([gridContainerClassname, className]), role: ariaRoles.table, style: {
|
|
38
38
|
tableLayout: enableResizeableColumns ? 'fixed' : 'auto',
|
|
39
39
|
'--density': theme.sizes[density],
|
|
40
40
|
...pinnedColumnLayoutStyles,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GridContainer.js","sources":["../../../../../src/components/DataGrid/components/GridContainer/GridContainer.tsx"],"sourcesContent":["import React, { RefObject, CSSProperties, ReactNode, AriaAttributes } from 'react';\nimport { Table } from '@tanstack/react-table';\n\nimport { theme } from 'Theme';\nimport { SizeScale } from 'Theme/modules/sizes';\n\nimport { useScrollPosition } from '../../../../hooks';\nimport { BorderMode } from '../../types/enums';\nimport { AriaRoles } from '../../types';\nimport { buildClassnames } from '../../../../utils/buildClassnames';\n\nimport { Container } from './Container';\n\nimport styles from './GridContainer.module.scss';\nimport { usePinnedColumnLayout } from '../../hooks';\n\ntype GridContainerProps = Pick<AriaAttributes, 'aria-label'> &\n Pick<React.HTMLAttributes<HTMLTableElement>, 'id' | 'className'> & {\n /**\n * Reference to be used for the outer container element.\n */\n containerRef?: RefObject<HTMLDivElement | null>;\n\n /**\n * Reference to be used for the table element.\n */\n tableRef?: RefObject<HTMLTableElement | null>;\n\n /**\n * Border mode.\n */\n borderMode: BorderMode;\n\n /**\n * Additional container styles.\n */\n containerStyles?: CSSProperties;\n\n /**\n * ARIA roles used in the grid.\n */\n ariaRoles: AriaRoles;\n\n /**\n * Whether resizeable columns are enabled or not.\n */\n enableResizeableColumns: boolean;\n\n /**\n * Density of the grid.\n */\n density: keyof SizeScale;\n\n /**\n * The TanStack Table instance.\n */\n table: Table<any>;\n\n /**\n * Child elements (table contents).\n */\n children: ReactNode;\n };\n\nconst gridContainerClassname = buildClassnames([styles.dataGridStyle, 'data-grid']);\n\n/**\n * The Grid container, which includes a wrapper and the table element itself. Controls table layout, applies\n * styling and sets table-specific CSS variables (such as density).\n */\nexport const GridContainer = ({\n containerRef,\n tableRef,\n borderMode,\n containerStyles,\n ariaRoles,\n enableResizeableColumns,\n density,\n table,\n children,\n id,\n className,\n 'aria-label': ariaLabel,\n}: GridContainerProps) => {\n const { pinnedColumnLayoutStyles } = usePinnedColumnLayout({ table });\n const { scrollPosition, onScroll, enableTransition } = useScrollPosition({ containerRef });\n\n // CSS variables to control pinned column shadow visibility\n const hideShadows = !scrollPosition || scrollPosition === 'none';\n const shadowVisibility = {\n '--pinned-left-shadow-opacity': hideShadows || scrollPosition === 'start' ? 0 : 1,\n '--pinned-right-shadow-opacity': hideShadows || scrollPosition === 'end' ? 0 : 1,\n '--pinned-shadow-transition-duration': enableTransition ? '0.3s' : '0s',\n };\n\n return (\n <Container\n ref={containerRef}\n borderMode={borderMode}\n style={containerStyles}\n onScroll={onScroll}\n >\n <table\n id={id}\n ref={tableRef}\n className={buildClassnames([gridContainerClassname, className])}\n role={ariaRoles.table}\n style={\n {\n tableLayout: enableResizeableColumns ? 'fixed' : 'auto',\n '--density': theme.sizes[density],\n ...pinnedColumnLayoutStyles,\n ...shadowVisibility,\n } as CSSProperties\n }\n aria-colcount={table.getFlatHeaders().length}\n aria-rowcount={table.getRowCount()}\n aria-label={ariaLabel}\n >\n {children}\n </table>\n </Container>\n );\n};\n"],"names":["React"],"mappings":";;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"GridContainer.js","sources":["../../../../../src/components/DataGrid/components/GridContainer/GridContainer.tsx"],"sourcesContent":["import React, { RefObject, CSSProperties, ReactNode, AriaAttributes } from 'react';\nimport { Table } from '@tanstack/react-table';\n\nimport { theme } from 'Theme';\nimport { SizeScale } from 'Theme/modules/sizes';\n\nimport { useScrollPosition } from '../../../../hooks';\nimport { BorderMode } from '../../types/enums';\nimport { AriaRoles } from '../../types';\nimport { DataAttributes } from '../../../types';\nimport { buildClassnames } from '../../../../utils/buildClassnames';\n\nimport { Container } from './Container';\n\nimport styles from './GridContainer.module.scss';\nimport { usePinnedColumnLayout } from '../../hooks';\n\ntype GridContainerProps = Pick<AriaAttributes, 'aria-label'> &\n Pick<React.HTMLAttributes<HTMLTableElement>, 'id' | 'className'> &\n DataAttributes & {\n /**\n * Reference to be used for the outer container element.\n */\n containerRef?: RefObject<HTMLDivElement | null>;\n\n /**\n * Reference to be used for the table element.\n */\n tableRef?: RefObject<HTMLTableElement | null>;\n\n /**\n * Border mode.\n */\n borderMode: BorderMode;\n\n /**\n * Additional container styles.\n */\n containerStyles?: CSSProperties;\n\n /**\n * ARIA roles used in the grid.\n */\n ariaRoles: AriaRoles;\n\n /**\n * Whether resizeable columns are enabled or not.\n */\n enableResizeableColumns: boolean;\n\n /**\n * Density of the grid.\n */\n density: keyof SizeScale;\n\n /**\n * The TanStack Table instance.\n */\n table: Table<any>;\n\n /**\n * Child elements (table contents).\n */\n children: ReactNode;\n };\n\nconst gridContainerClassname = buildClassnames([styles.dataGridStyle, 'data-grid']);\n\n/**\n * The Grid container, which includes a wrapper and the table element itself. Controls table layout, applies\n * styling and sets table-specific CSS variables (such as density).\n */\nexport const GridContainer = ({\n containerRef,\n tableRef,\n borderMode,\n containerStyles,\n ariaRoles,\n enableResizeableColumns,\n density,\n table,\n children,\n id,\n className,\n 'aria-label': ariaLabel,\n ...rest\n}: GridContainerProps) => {\n const { pinnedColumnLayoutStyles } = usePinnedColumnLayout({ table });\n const { scrollPosition, onScroll, enableTransition } = useScrollPosition({ containerRef });\n\n // CSS variables to control pinned column shadow visibility\n const hideShadows = !scrollPosition || scrollPosition === 'none';\n const shadowVisibility = {\n '--pinned-left-shadow-opacity': hideShadows || scrollPosition === 'start' ? 0 : 1,\n '--pinned-right-shadow-opacity': hideShadows || scrollPosition === 'end' ? 0 : 1,\n '--pinned-shadow-transition-duration': enableTransition ? '0.3s' : '0s',\n };\n\n return (\n <Container\n ref={containerRef}\n borderMode={borderMode}\n style={containerStyles}\n onScroll={onScroll}\n >\n <table\n {...rest}\n id={id}\n ref={tableRef}\n className={buildClassnames([gridContainerClassname, className])}\n role={ariaRoles.table}\n style={\n {\n tableLayout: enableResizeableColumns ? 'fixed' : 'auto',\n '--density': theme.sizes[density],\n ...pinnedColumnLayoutStyles,\n ...shadowVisibility,\n } as CSSProperties\n }\n aria-colcount={table.getFlatHeaders().length}\n aria-rowcount={table.getRowCount()}\n aria-label={ariaLabel}\n >\n {children}\n </table>\n </Container>\n );\n};\n"],"names":["React"],"mappings":";;;;;;;;;;;;;;;;;;;;AAkEA,MAAM,sBAAsB,GAAG,eAAe,CAAC,CAAC,MAAM,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC;AAEnF;;;AAGG;AACI,MAAM,aAAa,GAAG,CAAC,EAC5B,YAAY,EACZ,QAAQ,EACR,UAAU,EACV,eAAe,EACf,SAAS,EACT,uBAAuB,EACvB,OAAO,EACP,KAAK,EACL,QAAQ,EACR,EAAE,EACF,SAAS,EACT,YAAY,EAAE,SAAS,EACvB,GAAG,IAAI,EACY,KAAI;IACvB,MAAM,EAAE,wBAAwB,EAAE,GAAG,qBAAqB,CAAC,EAAE,KAAK,EAAE,CAAC;AACrE,IAAA,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,gBAAgB,EAAE,GAAG,iBAAiB,CAAC,EAAE,YAAY,EAAE,CAAC;;IAG1F,MAAM,WAAW,GAAG,CAAC,cAAc,IAAI,cAAc,KAAK,MAAM;AAChE,IAAA,MAAM,gBAAgB,GAAG;AACvB,QAAA,8BAA8B,EAAE,WAAW,IAAI,cAAc,KAAK,OAAO,GAAG,CAAC,GAAG,CAAC;AACjF,QAAA,+BAA+B,EAAE,WAAW,IAAI,cAAc,KAAK,KAAK,GAAG,CAAC,GAAG,CAAC;QAChF,qCAAqC,EAAE,gBAAgB,GAAG,MAAM,GAAG,IAAI;KACxE;AAED,IAAA,QACEA,cAAA,CAAA,aAAA,CAAC,SAAS,IACR,GAAG,EAAE,YAAY,EACjB,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,eAAe,EACtB,QAAQ,EAAE,QAAQ,EAAA;AAElB,QAAAA,cAAA,CAAA,aAAA,CAAA,OAAA,EAAA,EAAA,GACM,IAAI,EACR,EAAE,EAAE,EAAE,EACN,GAAG,EAAE,QAAQ,EACb,SAAS,EAAE,eAAe,CAAC,CAAC,sBAAsB,EAAE,SAAS,CAAC,CAAC,EAC/D,IAAI,EAAE,SAAS,CAAC,KAAK,EACrB,KAAK,EACH;gBACE,WAAW,EAAE,uBAAuB,GAAG,OAAO,GAAG,MAAM;AACvD,gBAAA,WAAW,EAAE,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC;AACjC,gBAAA,GAAG,wBAAwB;AAC3B,gBAAA,GAAG,gBAAgB;AACH,aAAA,EAAA,eAAA,EAEL,KAAK,CAAC,cAAc,EAAE,CAAC,MAAM,mBAC7B,KAAK,CAAC,WAAW,EAAE,gBACtB,SAAS,EAAA,EAEpB,QAAQ,CACH,CACE;AAEhB;;;;"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { AriaAttributes } from 'react';
|
|
2
2
|
import { SizeScale } from 'Theme/modules/sizes';
|
|
3
|
+
import { DataAttributes } from '../../types';
|
|
3
4
|
import { BorderMode, ResizeMode, SelectionMode } from './enums';
|
|
4
5
|
import { ColumnDefinition } from './ColumnDefinition';
|
|
5
6
|
import { SortState } from './SortState';
|
|
@@ -8,7 +9,7 @@ import { RowGroupingConfiguration } from './RowGroupingConfiguration';
|
|
|
8
9
|
import { ColumnWidths } from './ColumnWidths';
|
|
9
10
|
import { EmptyState } from './EmptyState';
|
|
10
11
|
import { RowThemeMap } from './RowTheme';
|
|
11
|
-
export type DataGridProps = Pick<AriaAttributes, 'aria-label'> & Pick<React.HTMLAttributes<HTMLTableElement>, 'className' | 'id'> & {
|
|
12
|
+
export type DataGridProps = Pick<AriaAttributes, 'aria-label'> & Pick<React.HTMLAttributes<HTMLTableElement>, 'className' | 'id'> & DataAttributes & {
|
|
12
13
|
/** General config */
|
|
13
14
|
/**
|
|
14
15
|
* Density, controls the spacing between rows in the table.
|
|
@@ -22,13 +22,13 @@ function _interopNamespaceCompat(e) {
|
|
|
22
22
|
|
|
23
23
|
var React__namespace = /*#__PURE__*/_interopNamespaceCompat(React);
|
|
24
24
|
|
|
25
|
-
const CreditIcon = (props) => (React__namespace.createElement("svg", { viewBox: "0 0
|
|
26
|
-
React__namespace.createElement("path", { d: "
|
|
27
|
-
React__namespace.createElement("path", { d: "
|
|
28
|
-
React__namespace.createElement("path", { d: "
|
|
29
|
-
React__namespace.createElement("path", { d: "
|
|
30
|
-
React__namespace.createElement("path", { d: "
|
|
31
|
-
React__namespace.createElement("path", { d: "
|
|
25
|
+
const CreditIcon = (props) => (React__namespace.createElement("svg", { viewBox: "0 0 32 32", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-label": "Veeqo Credits", ...props },
|
|
26
|
+
React__namespace.createElement("path", { fill: "#1da563", d: "M31.361 17.28c0 8.597-6.813 14.388-15.411 14.388S.383 24.698.383 16.101 5.12 1.28 16.103.267C28.16.64 31.36 8.682 31.36 17.28" }),
|
|
27
|
+
React__namespace.createElement("path", { fill: "#1da563", d: "M16 0C5.753 0 0 5.753 0 16s5.753 16 16 16 16-5.753 16-16S26.247 0 16 0m0 31.02C6.654 31.02.878 25.351.878 16S6.654.992 16 .992C25.351.992 31.21 6.654 31.21 16S25.347 31.02 16 31.02" }),
|
|
28
|
+
React__namespace.createElement("path", { fill: "#fff", d: "M12.868 4.825a4.45 4.45 0 0 1 6.293 0l8.043 8.043a4.45 4.45 0 0 1 0 6.293l-8.043 8.043a4.45 4.45 0 0 1-6.293 0L4.825 19.16a4.45 4.45 0 0 1 0-6.292z" }),
|
|
29
|
+
React__namespace.createElement("path", { stroke: "#1da563", d: "M12.868 4.825a4.45 4.45 0 0 1 6.293 0l8.043 8.043a4.45 4.45 0 0 1 0 6.293l-8.043 8.043a4.45 4.45 0 0 1-6.293 0L4.825 19.16a4.45 4.45 0 0 1 0-6.292z" }),
|
|
30
|
+
React__namespace.createElement("path", { fill: "#065931", d: "M16.238 7.823c.345 0 .624.279.625.623v1.111c1.513.292 2.807 1.336 3.354 2.792a.936.936 0 0 1-1.752.658c-.37-.984-1.379-1.67-2.455-1.67h-.088c-.818-.013-1.628.277-2.097.743-.312.308-.47.686-.471 1.122a1.524 1.524 0 0 0 1.303 1.526l3.01.531c1.653.24 2.875 1.66 2.875 3.375v.157a1 1 0 0 1-.005.093c-.193 1.914-1.69 3.339-3.674 3.61v1.071c0 .344-.28.623-.625.623h-.622a.624.624 0 0 1-.624-.623v-1.151c-1.437-.337-2.655-1.351-3.182-2.75a.936.936 0 0 1 1.75-.66c.37.983 1.381 1.67 2.456 1.67h.089c1.14.008 2.405-.582 2.567-1.935v-.105c0-.776-.548-1.419-1.303-1.528l-3.01-.532c-1.65-.239-2.87-1.654-2.875-3.363v-.017a3.39 3.39 0 0 1 1.024-2.442c.626-.62 1.514-1.044 2.484-1.208V8.446c0-.344.28-.623.624-.623z" }),
|
|
31
|
+
React__namespace.createElement("path", { stroke: "#1da563", d: "M16.238 7.823c.345 0 .624.279.625.623v1.111c1.513.292 2.807 1.336 3.354 2.792a.936.936 0 0 1-1.752.658c-.37-.984-1.379-1.67-2.455-1.67h-.088c-.818-.013-1.628.277-2.097.743-.312.308-.47.686-.471 1.122a1.524 1.524 0 0 0 1.303 1.526l3.01.531c1.653.24 2.875 1.66 2.875 3.375v.157a1 1 0 0 1-.005.093c-.193 1.914-1.69 3.339-3.674 3.61v1.071c0 .344-.28.623-.625.623h-.622a.624.624 0 0 1-.624-.623v-1.151c-1.437-.337-2.655-1.351-3.182-2.75a.936.936 0 0 1 1.75-.66c.37.983 1.381 1.67 2.456 1.67h.089c1.14.008 2.405-.582 2.567-1.935v-.105c0-.776-.548-1.419-1.303-1.528l-3.01-.532c-1.65-.239-2.87-1.654-2.875-3.363v-.017a3.39 3.39 0 0 1 1.024-2.442c.626-.62 1.514-1.044 2.484-1.208V8.446c0-.344.28-.623.624-.623z" })));
|
|
32
32
|
|
|
33
33
|
exports.CreditIcon = CreditIcon;
|
|
34
34
|
//# sourceMappingURL=CreditIcon.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreditIcon.cjs","sources":["../../../../src/icons/custom/components/CreditIcon.tsx"],"sourcesContent":["import * as React from 'react';\nimport { IconComponentProps } from 'src/icons/types';\n\nexport const CreditIcon = (props: IconComponentProps) => (\n <svg\n viewBox=\"0 0
|
|
1
|
+
{"version":3,"file":"CreditIcon.cjs","sources":["../../../../src/icons/custom/components/CreditIcon.tsx"],"sourcesContent":["import * as React from 'react';\nimport { IconComponentProps } from 'src/icons/types';\n\nexport const CreditIcon = (props: IconComponentProps) => (\n <svg\n viewBox=\"0 0 32 32\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-label=\"Veeqo Credits\"\n {...props}\n >\n <path\n fill=\"#1da563\"\n d=\"M31.361 17.28c0 8.597-6.813 14.388-15.411 14.388S.383 24.698.383 16.101 5.12 1.28 16.103.267C28.16.64 31.36 8.682 31.36 17.28\"\n />\n <path\n fill=\"#1da563\"\n d=\"M16 0C5.753 0 0 5.753 0 16s5.753 16 16 16 16-5.753 16-16S26.247 0 16 0m0 31.02C6.654 31.02.878 25.351.878 16S6.654.992 16 .992C25.351.992 31.21 6.654 31.21 16S25.347 31.02 16 31.02\"\n />\n <path\n fill=\"#fff\"\n d=\"M12.868 4.825a4.45 4.45 0 0 1 6.293 0l8.043 8.043a4.45 4.45 0 0 1 0 6.293l-8.043 8.043a4.45 4.45 0 0 1-6.293 0L4.825 19.16a4.45 4.45 0 0 1 0-6.292z\"\n />\n <path\n stroke=\"#1da563\"\n d=\"M12.868 4.825a4.45 4.45 0 0 1 6.293 0l8.043 8.043a4.45 4.45 0 0 1 0 6.293l-8.043 8.043a4.45 4.45 0 0 1-6.293 0L4.825 19.16a4.45 4.45 0 0 1 0-6.292z\"\n />\n <path\n fill=\"#065931\"\n d=\"M16.238 7.823c.345 0 .624.279.625.623v1.111c1.513.292 2.807 1.336 3.354 2.792a.936.936 0 0 1-1.752.658c-.37-.984-1.379-1.67-2.455-1.67h-.088c-.818-.013-1.628.277-2.097.743-.312.308-.47.686-.471 1.122a1.524 1.524 0 0 0 1.303 1.526l3.01.531c1.653.24 2.875 1.66 2.875 3.375v.157a1 1 0 0 1-.005.093c-.193 1.914-1.69 3.339-3.674 3.61v1.071c0 .344-.28.623-.625.623h-.622a.624.624 0 0 1-.624-.623v-1.151c-1.437-.337-2.655-1.351-3.182-2.75a.936.936 0 0 1 1.75-.66c.37.983 1.381 1.67 2.456 1.67h.089c1.14.008 2.405-.582 2.567-1.935v-.105c0-.776-.548-1.419-1.303-1.528l-3.01-.532c-1.65-.239-2.87-1.654-2.875-3.363v-.017a3.39 3.39 0 0 1 1.024-2.442c.626-.62 1.514-1.044 2.484-1.208V8.446c0-.344.28-.623.624-.623z\"\n />\n <path\n stroke=\"#1da563\"\n d=\"M16.238 7.823c.345 0 .624.279.625.623v1.111c1.513.292 2.807 1.336 3.354 2.792a.936.936 0 0 1-1.752.658c-.37-.984-1.379-1.67-2.455-1.67h-.088c-.818-.013-1.628.277-2.097.743-.312.308-.47.686-.471 1.122a1.524 1.524 0 0 0 1.303 1.526l3.01.531c1.653.24 2.875 1.66 2.875 3.375v.157a1 1 0 0 1-.005.093c-.193 1.914-1.69 3.339-3.674 3.61v1.071c0 .344-.28.623-.625.623h-.622a.624.624 0 0 1-.624-.623v-1.151c-1.437-.337-2.655-1.351-3.182-2.75a.936.936 0 0 1 1.75-.66c.37.983 1.381 1.67 2.456 1.67h.089c1.14.008 2.405-.582 2.567-1.935v-.105c0-.776-.548-1.419-1.303-1.528l-3.01-.532c-1.65-.239-2.87-1.654-2.875-3.363v-.017a3.39 3.39 0 0 1 1.024-2.442c.626-.62 1.514-1.044 2.484-1.208V8.446c0-.344.28-.623.624-.623z\"\n />\n </svg>\n);\n"],"names":["React"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAGO,MAAM,UAAU,GAAG,CAAC,KAAyB,MAClDA,gBAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EACE,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,4BAA4B,EAAA,YAAA,EACvB,eAAe,EAAA,GACtB,KAAK,EAAA;AAET,IAAAA,gBAAA,CAAA,aAAA,CAAA,MAAA,EAAA,EACE,IAAI,EAAC,SAAS,EACd,CAAC,EAAC,+HAA+H,EAAA,CACjI;AACF,IAAAA,gBAAA,CAAA,aAAA,CAAA,MAAA,EAAA,EACE,IAAI,EAAC,SAAS,EACd,CAAC,EAAC,sLAAsL,EAAA,CACxL;AACF,IAAAA,gBAAA,CAAA,aAAA,CAAA,MAAA,EAAA,EACE,IAAI,EAAC,MAAM,EACX,CAAC,EAAC,qJAAqJ,EAAA,CACvJ;AACF,IAAAA,gBAAA,CAAA,aAAA,CAAA,MAAA,EAAA,EACE,MAAM,EAAC,SAAS,EAChB,CAAC,EAAC,qJAAqJ,EAAA,CACvJ;AACF,IAAAA,gBAAA,CAAA,aAAA,CAAA,MAAA,EAAA,EACE,IAAI,EAAC,SAAS,EACd,CAAC,EAAC,+rBAA+rB,EAAA,CACjsB;IACFA,gBAAA,CAAA,aAAA,CAAA,MAAA,EAAA,EACE,MAAM,EAAC,SAAS,EAChB,CAAC,EAAC,+rBAA+rB,EAAA,CACjsB,CACE;;;;"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
|
|
3
|
-
const CreditIcon = (props) => (React.createElement("svg", { viewBox: "0 0
|
|
4
|
-
React.createElement("path", { d: "
|
|
5
|
-
React.createElement("path", { d: "
|
|
6
|
-
React.createElement("path", { d: "
|
|
7
|
-
React.createElement("path", { d: "
|
|
8
|
-
React.createElement("path", { d: "
|
|
9
|
-
React.createElement("path", { d: "
|
|
3
|
+
const CreditIcon = (props) => (React.createElement("svg", { viewBox: "0 0 32 32", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-label": "Veeqo Credits", ...props },
|
|
4
|
+
React.createElement("path", { fill: "#1da563", d: "M31.361 17.28c0 8.597-6.813 14.388-15.411 14.388S.383 24.698.383 16.101 5.12 1.28 16.103.267C28.16.64 31.36 8.682 31.36 17.28" }),
|
|
5
|
+
React.createElement("path", { fill: "#1da563", d: "M16 0C5.753 0 0 5.753 0 16s5.753 16 16 16 16-5.753 16-16S26.247 0 16 0m0 31.02C6.654 31.02.878 25.351.878 16S6.654.992 16 .992C25.351.992 31.21 6.654 31.21 16S25.347 31.02 16 31.02" }),
|
|
6
|
+
React.createElement("path", { fill: "#fff", d: "M12.868 4.825a4.45 4.45 0 0 1 6.293 0l8.043 8.043a4.45 4.45 0 0 1 0 6.293l-8.043 8.043a4.45 4.45 0 0 1-6.293 0L4.825 19.16a4.45 4.45 0 0 1 0-6.292z" }),
|
|
7
|
+
React.createElement("path", { stroke: "#1da563", d: "M12.868 4.825a4.45 4.45 0 0 1 6.293 0l8.043 8.043a4.45 4.45 0 0 1 0 6.293l-8.043 8.043a4.45 4.45 0 0 1-6.293 0L4.825 19.16a4.45 4.45 0 0 1 0-6.292z" }),
|
|
8
|
+
React.createElement("path", { fill: "#065931", d: "M16.238 7.823c.345 0 .624.279.625.623v1.111c1.513.292 2.807 1.336 3.354 2.792a.936.936 0 0 1-1.752.658c-.37-.984-1.379-1.67-2.455-1.67h-.088c-.818-.013-1.628.277-2.097.743-.312.308-.47.686-.471 1.122a1.524 1.524 0 0 0 1.303 1.526l3.01.531c1.653.24 2.875 1.66 2.875 3.375v.157a1 1 0 0 1-.005.093c-.193 1.914-1.69 3.339-3.674 3.61v1.071c0 .344-.28.623-.625.623h-.622a.624.624 0 0 1-.624-.623v-1.151c-1.437-.337-2.655-1.351-3.182-2.75a.936.936 0 0 1 1.75-.66c.37.983 1.381 1.67 2.456 1.67h.089c1.14.008 2.405-.582 2.567-1.935v-.105c0-.776-.548-1.419-1.303-1.528l-3.01-.532c-1.65-.239-2.87-1.654-2.875-3.363v-.017a3.39 3.39 0 0 1 1.024-2.442c.626-.62 1.514-1.044 2.484-1.208V8.446c0-.344.28-.623.624-.623z" }),
|
|
9
|
+
React.createElement("path", { stroke: "#1da563", d: "M16.238 7.823c.345 0 .624.279.625.623v1.111c1.513.292 2.807 1.336 3.354 2.792a.936.936 0 0 1-1.752.658c-.37-.984-1.379-1.67-2.455-1.67h-.088c-.818-.013-1.628.277-2.097.743-.312.308-.47.686-.471 1.122a1.524 1.524 0 0 0 1.303 1.526l3.01.531c1.653.24 2.875 1.66 2.875 3.375v.157a1 1 0 0 1-.005.093c-.193 1.914-1.69 3.339-3.674 3.61v1.071c0 .344-.28.623-.625.623h-.622a.624.624 0 0 1-.624-.623v-1.151c-1.437-.337-2.655-1.351-3.182-2.75a.936.936 0 0 1 1.75-.66c.37.983 1.381 1.67 2.456 1.67h.089c1.14.008 2.405-.582 2.567-1.935v-.105c0-.776-.548-1.419-1.303-1.528l-3.01-.532c-1.65-.239-2.87-1.654-2.875-3.363v-.017a3.39 3.39 0 0 1 1.024-2.442c.626-.62 1.514-1.044 2.484-1.208V8.446c0-.344.28-.623.624-.623z" })));
|
|
10
10
|
|
|
11
11
|
export { CreditIcon };
|
|
12
12
|
//# sourceMappingURL=CreditIcon.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreditIcon.js","sources":["../../../../src/icons/custom/components/CreditIcon.tsx"],"sourcesContent":["import * as React from 'react';\nimport { IconComponentProps } from 'src/icons/types';\n\nexport const CreditIcon = (props: IconComponentProps) => (\n <svg\n viewBox=\"0 0
|
|
1
|
+
{"version":3,"file":"CreditIcon.js","sources":["../../../../src/icons/custom/components/CreditIcon.tsx"],"sourcesContent":["import * as React from 'react';\nimport { IconComponentProps } from 'src/icons/types';\n\nexport const CreditIcon = (props: IconComponentProps) => (\n <svg\n viewBox=\"0 0 32 32\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-label=\"Veeqo Credits\"\n {...props}\n >\n <path\n fill=\"#1da563\"\n d=\"M31.361 17.28c0 8.597-6.813 14.388-15.411 14.388S.383 24.698.383 16.101 5.12 1.28 16.103.267C28.16.64 31.36 8.682 31.36 17.28\"\n />\n <path\n fill=\"#1da563\"\n d=\"M16 0C5.753 0 0 5.753 0 16s5.753 16 16 16 16-5.753 16-16S26.247 0 16 0m0 31.02C6.654 31.02.878 25.351.878 16S6.654.992 16 .992C25.351.992 31.21 6.654 31.21 16S25.347 31.02 16 31.02\"\n />\n <path\n fill=\"#fff\"\n d=\"M12.868 4.825a4.45 4.45 0 0 1 6.293 0l8.043 8.043a4.45 4.45 0 0 1 0 6.293l-8.043 8.043a4.45 4.45 0 0 1-6.293 0L4.825 19.16a4.45 4.45 0 0 1 0-6.292z\"\n />\n <path\n stroke=\"#1da563\"\n d=\"M12.868 4.825a4.45 4.45 0 0 1 6.293 0l8.043 8.043a4.45 4.45 0 0 1 0 6.293l-8.043 8.043a4.45 4.45 0 0 1-6.293 0L4.825 19.16a4.45 4.45 0 0 1 0-6.292z\"\n />\n <path\n fill=\"#065931\"\n d=\"M16.238 7.823c.345 0 .624.279.625.623v1.111c1.513.292 2.807 1.336 3.354 2.792a.936.936 0 0 1-1.752.658c-.37-.984-1.379-1.67-2.455-1.67h-.088c-.818-.013-1.628.277-2.097.743-.312.308-.47.686-.471 1.122a1.524 1.524 0 0 0 1.303 1.526l3.01.531c1.653.24 2.875 1.66 2.875 3.375v.157a1 1 0 0 1-.005.093c-.193 1.914-1.69 3.339-3.674 3.61v1.071c0 .344-.28.623-.625.623h-.622a.624.624 0 0 1-.624-.623v-1.151c-1.437-.337-2.655-1.351-3.182-2.75a.936.936 0 0 1 1.75-.66c.37.983 1.381 1.67 2.456 1.67h.089c1.14.008 2.405-.582 2.567-1.935v-.105c0-.776-.548-1.419-1.303-1.528l-3.01-.532c-1.65-.239-2.87-1.654-2.875-3.363v-.017a3.39 3.39 0 0 1 1.024-2.442c.626-.62 1.514-1.044 2.484-1.208V8.446c0-.344.28-.623.624-.623z\"\n />\n <path\n stroke=\"#1da563\"\n d=\"M16.238 7.823c.345 0 .624.279.625.623v1.111c1.513.292 2.807 1.336 3.354 2.792a.936.936 0 0 1-1.752.658c-.37-.984-1.379-1.67-2.455-1.67h-.088c-.818-.013-1.628.277-2.097.743-.312.308-.47.686-.471 1.122a1.524 1.524 0 0 0 1.303 1.526l3.01.531c1.653.24 2.875 1.66 2.875 3.375v.157a1 1 0 0 1-.005.093c-.193 1.914-1.69 3.339-3.674 3.61v1.071c0 .344-.28.623-.625.623h-.622a.624.624 0 0 1-.624-.623v-1.151c-1.437-.337-2.655-1.351-3.182-2.75a.936.936 0 0 1 1.75-.66c.37.983 1.381 1.67 2.456 1.67h.089c1.14.008 2.405-.582 2.567-1.935v-.105c0-.776-.548-1.419-1.303-1.528l-3.01-.532c-1.65-.239-2.87-1.654-2.875-3.363v-.017a3.39 3.39 0 0 1 1.024-2.442c.626-.62 1.514-1.044 2.484-1.208V8.446c0-.344.28-.623.624-.623z\"\n />\n </svg>\n);\n"],"names":[],"mappings":";;AAGO,MAAM,UAAU,GAAG,CAAC,KAAyB,MAClD,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EACE,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,4BAA4B,EAAA,YAAA,EACvB,eAAe,EAAA,GACtB,KAAK,EAAA;AAET,IAAA,KAAA,CAAA,aAAA,CAAA,MAAA,EAAA,EACE,IAAI,EAAC,SAAS,EACd,CAAC,EAAC,+HAA+H,EAAA,CACjI;AACF,IAAA,KAAA,CAAA,aAAA,CAAA,MAAA,EAAA,EACE,IAAI,EAAC,SAAS,EACd,CAAC,EAAC,sLAAsL,EAAA,CACxL;AACF,IAAA,KAAA,CAAA,aAAA,CAAA,MAAA,EAAA,EACE,IAAI,EAAC,MAAM,EACX,CAAC,EAAC,qJAAqJ,EAAA,CACvJ;AACF,IAAA,KAAA,CAAA,aAAA,CAAA,MAAA,EAAA,EACE,MAAM,EAAC,SAAS,EAChB,CAAC,EAAC,qJAAqJ,EAAA,CACvJ;AACF,IAAA,KAAA,CAAA,aAAA,CAAA,MAAA,EAAA,EACE,IAAI,EAAC,SAAS,EACd,CAAC,EAAC,+rBAA+rB,EAAA,CACjsB;IACF,KAAA,CAAA,aAAA,CAAA,MAAA,EAAA,EACE,MAAM,EAAC,SAAS,EAChB,CAAC,EAAC,+rBAA+rB,EAAA,CACjsB,CACE;;;;"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
|
|
5
|
+
function _interopNamespaceCompat(e) {
|
|
6
|
+
if (e && typeof e === 'object' && 'default' in e) return e;
|
|
7
|
+
var n = Object.create(null);
|
|
8
|
+
if (e) {
|
|
9
|
+
Object.keys(e).forEach(function (k) {
|
|
10
|
+
if (k !== 'default') {
|
|
11
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
12
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () { return e[k]; }
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
n.default = e;
|
|
20
|
+
return Object.freeze(n);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
var React__namespace = /*#__PURE__*/_interopNamespaceCompat(React);
|
|
24
|
+
|
|
25
|
+
const ShipPlusCreditIcon = (props) => (React__namespace.createElement("svg", { viewBox: "0 0 32 32", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-label": "Ship Plus Credits", ...props },
|
|
26
|
+
React__namespace.createElement("path", { fill: "#0066c0", d: "M0 16C0 7.163 7.163 0 16 0s16 7.163 16 16-7.163 16-16 16S0 24.837 0 16" }),
|
|
27
|
+
React__namespace.createElement("path", { fill: "#fff", d: "M16.226 7.815c.344 0 .623.28.623.624v1.11c1.514.292 2.808 1.337 3.355 2.793a.936.936 0 0 1-1.752.657c-.37-.983-1.378-1.67-2.455-1.67h-.089c-.818-.012-1.627.278-2.097.744-.312.308-.47.687-.47 1.123 0 .775.549 1.416 1.303 1.525l3.01.532c1.654.24 2.875 1.661 2.875 3.376v.157a1 1 0 0 1-.004.093c-.194 1.915-1.692 3.34-3.676 3.612v1.07a.624.624 0 0 1-.623.624h-.624a.624.624 0 0 1-.623-.624V22.41c-1.437-.337-2.655-1.352-3.183-2.751a.936.936 0 0 1 1.751-.66c.37.984 1.38 1.67 2.455 1.67h.09c1.14.008 2.405-.582 2.567-1.935v-.105c0-.776-.548-1.42-1.302-1.529l-3.01-.531c-1.651-.239-2.872-1.655-2.877-3.365v-.016a3.39 3.39 0 0 1 1.024-2.443c.626-.62 1.515-1.044 2.485-1.208V8.439c0-.344.279-.624.623-.624z" })));
|
|
28
|
+
|
|
29
|
+
exports.ShipPlusCreditIcon = ShipPlusCreditIcon;
|
|
30
|
+
//# sourceMappingURL=ShipPlusCreditIcon.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ShipPlusCreditIcon.cjs","sources":["../../../../src/icons/custom/components/ShipPlusCreditIcon.tsx"],"sourcesContent":["import * as React from 'react';\nimport { IconComponentProps } from 'src/icons/types';\n\nexport const ShipPlusCreditIcon = (props: IconComponentProps) => (\n <svg\n viewBox=\"0 0 32 32\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-label=\"Ship Plus Credits\"\n {...props}\n >\n <path\n fill=\"#0066c0\"\n d=\"M0 16C0 7.163 7.163 0 16 0s16 7.163 16 16-7.163 16-16 16S0 24.837 0 16\"\n />\n <path\n fill=\"#fff\"\n d=\"M16.226 7.815c.344 0 .623.28.623.624v1.11c1.514.292 2.808 1.337 3.355 2.793a.936.936 0 0 1-1.752.657c-.37-.983-1.378-1.67-2.455-1.67h-.089c-.818-.012-1.627.278-2.097.744-.312.308-.47.687-.47 1.123 0 .775.549 1.416 1.303 1.525l3.01.532c1.654.24 2.875 1.661 2.875 3.376v.157a1 1 0 0 1-.004.093c-.194 1.915-1.692 3.34-3.676 3.612v1.07a.624.624 0 0 1-.623.624h-.624a.624.624 0 0 1-.623-.624V22.41c-1.437-.337-2.655-1.352-3.183-2.751a.936.936 0 0 1 1.751-.66c.37.984 1.38 1.67 2.455 1.67h.09c1.14.008 2.405-.582 2.567-1.935v-.105c0-.776-.548-1.42-1.302-1.529l-3.01-.531c-1.651-.239-2.872-1.655-2.877-3.365v-.016a3.39 3.39 0 0 1 1.024-2.443c.626-.62 1.515-1.044 2.485-1.208V8.439c0-.344.279-.624.623-.624z\"\n />\n </svg>\n);\n"],"names":["React"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAGO,MAAM,kBAAkB,GAAG,CAAC,KAAyB,MAC1DA,gBAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EACE,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,4BAA4B,EAAA,YAAA,EACvB,mBAAmB,EAAA,GAC1B,KAAK,EAAA;AAET,IAAAA,gBAAA,CAAA,aAAA,CAAA,MAAA,EAAA,EACE,IAAI,EAAC,SAAS,EACd,CAAC,EAAC,wEAAwE,EAAA,CAC1E;IACFA,gBAAA,CAAA,aAAA,CAAA,MAAA,EAAA,EACE,IAAI,EAAC,MAAM,EACX,CAAC,EAAC,6rBAA6rB,EAAA,CAC/rB,CACE;;;;"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
const ShipPlusCreditIcon = (props) => (React.createElement("svg", { viewBox: "0 0 32 32", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-label": "Ship Plus Credits", ...props },
|
|
4
|
+
React.createElement("path", { fill: "#0066c0", d: "M0 16C0 7.163 7.163 0 16 0s16 7.163 16 16-7.163 16-16 16S0 24.837 0 16" }),
|
|
5
|
+
React.createElement("path", { fill: "#fff", d: "M16.226 7.815c.344 0 .623.28.623.624v1.11c1.514.292 2.808 1.337 3.355 2.793a.936.936 0 0 1-1.752.657c-.37-.983-1.378-1.67-2.455-1.67h-.089c-.818-.012-1.627.278-2.097.744-.312.308-.47.687-.47 1.123 0 .775.549 1.416 1.303 1.525l3.01.532c1.654.24 2.875 1.661 2.875 3.376v.157a1 1 0 0 1-.004.093c-.194 1.915-1.692 3.34-3.676 3.612v1.07a.624.624 0 0 1-.623.624h-.624a.624.624 0 0 1-.623-.624V22.41c-1.437-.337-2.655-1.352-3.183-2.751a.936.936 0 0 1 1.751-.66c.37.984 1.38 1.67 2.455 1.67h.09c1.14.008 2.405-.582 2.567-1.935v-.105c0-.776-.548-1.42-1.302-1.529l-3.01-.531c-1.651-.239-2.872-1.655-2.877-3.365v-.016a3.39 3.39 0 0 1 1.024-2.443c.626-.62 1.515-1.044 2.485-1.208V8.439c0-.344.279-.624.623-.624z" })));
|
|
6
|
+
|
|
7
|
+
export { ShipPlusCreditIcon };
|
|
8
|
+
//# sourceMappingURL=ShipPlusCreditIcon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ShipPlusCreditIcon.js","sources":["../../../../src/icons/custom/components/ShipPlusCreditIcon.tsx"],"sourcesContent":["import * as React from 'react';\nimport { IconComponentProps } from 'src/icons/types';\n\nexport const ShipPlusCreditIcon = (props: IconComponentProps) => (\n <svg\n viewBox=\"0 0 32 32\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-label=\"Ship Plus Credits\"\n {...props}\n >\n <path\n fill=\"#0066c0\"\n d=\"M0 16C0 7.163 7.163 0 16 0s16 7.163 16 16-7.163 16-16 16S0 24.837 0 16\"\n />\n <path\n fill=\"#fff\"\n d=\"M16.226 7.815c.344 0 .623.28.623.624v1.11c1.514.292 2.808 1.337 3.355 2.793a.936.936 0 0 1-1.752.657c-.37-.983-1.378-1.67-2.455-1.67h-.089c-.818-.012-1.627.278-2.097.744-.312.308-.47.687-.47 1.123 0 .775.549 1.416 1.303 1.525l3.01.532c1.654.24 2.875 1.661 2.875 3.376v.157a1 1 0 0 1-.004.093c-.194 1.915-1.692 3.34-3.676 3.612v1.07a.624.624 0 0 1-.623.624h-.624a.624.624 0 0 1-.623-.624V22.41c-1.437-.337-2.655-1.352-3.183-2.751a.936.936 0 0 1 1.751-.66c.37.984 1.38 1.67 2.455 1.67h.09c1.14.008 2.405-.582 2.567-1.935v-.105c0-.776-.548-1.42-1.302-1.529l-3.01-.531c-1.651-.239-2.872-1.655-2.877-3.365v-.016a3.39 3.39 0 0 1 1.024-2.443c.626-.62 1.515-1.044 2.485-1.208V8.439c0-.344.279-.624.623-.624z\"\n />\n </svg>\n);\n"],"names":[],"mappings":";;AAGO,MAAM,kBAAkB,GAAG,CAAC,KAAyB,MAC1D,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EACE,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,4BAA4B,EAAA,YAAA,EACvB,mBAAmB,EAAA,GAC1B,KAAK,EAAA;AAET,IAAA,KAAA,CAAA,aAAA,CAAA,MAAA,EAAA,EACE,IAAI,EAAC,SAAS,EACd,CAAC,EAAC,wEAAwE,EAAA,CAC1E;IACF,KAAA,CAAA,aAAA,CAAA,MAAA,EAAA,EACE,IAAI,EAAC,MAAM,EACX,CAAC,EAAC,6rBAA6rB,EAAA,CAC/rB,CACE;;;;"}
|
|
@@ -2,6 +2,7 @@ export { ActiveCheckboxIcon } from './components/ActiveCheckboxIcon';
|
|
|
2
2
|
export { ActiveRadioIcon } from './components/ActiveRadioIcon';
|
|
3
3
|
export { AmazonSmileIcon } from './components/AmazonSmileIcon';
|
|
4
4
|
export { CreditIcon } from './components/CreditIcon';
|
|
5
|
+
export { ShipPlusCreditIcon } from './components/ShipPlusCreditIcon';
|
|
5
6
|
export { DashboardIcon } from './components/DashboardIcon';
|
|
6
7
|
export { DestructiveIcon } from './components/DestructiveIcon';
|
|
7
8
|
export { DoubleArrowAscIcon } from './components/DoubleArrowAscIcon';
|
package/dist/index.cjs
CHANGED
|
@@ -316,6 +316,7 @@ var ActiveCheckboxIcon = require('./icons/custom/components/ActiveCheckboxIcon.c
|
|
|
316
316
|
var ActiveRadioIcon = require('./icons/custom/components/ActiveRadioIcon.cjs');
|
|
317
317
|
var AmazonSmileIcon = require('./icons/custom/components/AmazonSmileIcon.cjs');
|
|
318
318
|
var CreditIcon = require('./icons/custom/components/CreditIcon.cjs');
|
|
319
|
+
var ShipPlusCreditIcon = require('./icons/custom/components/ShipPlusCreditIcon.cjs');
|
|
319
320
|
var DashboardIcon = require('./icons/custom/components/DashboardIcon.cjs');
|
|
320
321
|
var DestructiveIcon = require('./icons/custom/components/DestructiveIcon.cjs');
|
|
321
322
|
var DoubleArrowAscIcon = require('./icons/custom/components/DoubleArrowAscIcon.cjs');
|
|
@@ -686,6 +687,7 @@ exports.ActiveCheckboxIcon = ActiveCheckboxIcon.ActiveCheckboxIcon;
|
|
|
686
687
|
exports.ActiveRadioIcon = ActiveRadioIcon.ActiveRadioIcon;
|
|
687
688
|
exports.AmazonSmileIcon = AmazonSmileIcon.AmazonSmileIcon;
|
|
688
689
|
exports.CreditIcon = CreditIcon.CreditIcon;
|
|
690
|
+
exports.ShipPlusCreditIcon = ShipPlusCreditIcon.ShipPlusCreditIcon;
|
|
689
691
|
exports.DashboardIcon = DashboardIcon.DashboardIcon;
|
|
690
692
|
exports.DestructiveIcon = DestructiveIcon.DestructiveIcon;
|
|
691
693
|
exports.DoubleArrowAscIcon = DoubleArrowAscIcon.DoubleArrowAscIcon;
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/index.js
CHANGED
|
@@ -314,6 +314,7 @@ export { ActiveCheckboxIcon } from './icons/custom/components/ActiveCheckboxIcon
|
|
|
314
314
|
export { ActiveRadioIcon } from './icons/custom/components/ActiveRadioIcon.js';
|
|
315
315
|
export { AmazonSmileIcon } from './icons/custom/components/AmazonSmileIcon.js';
|
|
316
316
|
export { CreditIcon } from './icons/custom/components/CreditIcon.js';
|
|
317
|
+
export { ShipPlusCreditIcon } from './icons/custom/components/ShipPlusCreditIcon.js';
|
|
317
318
|
export { DashboardIcon } from './icons/custom/components/DashboardIcon.js';
|
|
318
319
|
export { DestructiveIcon } from './icons/custom/components/DestructiveIcon.js';
|
|
319
320
|
export { DoubleArrowAscIcon } from './icons/custom/components/DoubleArrowAscIcon.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tag that opts a story (or its meta) into the pseudo-state matrix rendered by
|
|
3
|
+
* the global `withPseudoStates` decorator (see `.storybook/withPseudoStates.tsx`).
|
|
4
|
+
*
|
|
5
|
+
* IMPORTANT: Storybook's CSF indexer requires `tags` to be **string-literal**
|
|
6
|
+
* arrays, so this tag CANNOT be spread into a meta — add the literal string
|
|
7
|
+
* `'allStates'` to the meta's `tags` array, and spread {@link pseudoStatesParameters}
|
|
8
|
+
* for the accompanying a11y suppressions:
|
|
9
|
+
*
|
|
10
|
+
* ```ts
|
|
11
|
+
* const meta = {
|
|
12
|
+
* title: 'Components/Actions/Action',
|
|
13
|
+
* component: Action,
|
|
14
|
+
* tags: ['autodocs', 'allStates'],
|
|
15
|
+
* parameters: pseudoStatesParameters,
|
|
16
|
+
* } satisfies Meta<typeof Action>;
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export declare const PSEUDO_STATES_TAG = "allStates";
|
|
20
|
+
/**
|
|
21
|
+
* Parameters to attach to any meta that opts into the pseudo-state matrix.
|
|
22
|
+
*
|
|
23
|
+
* The story is rendered four times (normal, hover, active, focus-visible), so
|
|
24
|
+
* any `id` inside it is duplicated across columns — this disables the a11y
|
|
25
|
+
* rules that would otherwise fire on that duplication.
|
|
26
|
+
*
|
|
27
|
+
* ⚠️ Presentational components only. Do not apply the `allStates` tag to
|
|
28
|
+
* components that rely on unique `id`s (form fields), and do not combine it
|
|
29
|
+
* with `play` functions — `canvasElement` queries become ambiguous.
|
|
30
|
+
*/
|
|
31
|
+
export declare const pseudoStatesParameters: {
|
|
32
|
+
a11y: {
|
|
33
|
+
config: {
|
|
34
|
+
rules: {
|
|
35
|
+
id: string;
|
|
36
|
+
enabled: boolean;
|
|
37
|
+
}[];
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@veeqo/ui",
|
|
3
|
-
"version": "15.
|
|
3
|
+
"version": "15.23.0",
|
|
4
4
|
"description": "New optimised component library for Veeqo.",
|
|
5
5
|
"author": "Robert Wealthall",
|
|
6
6
|
"license": "ISC",
|
|
@@ -71,11 +71,13 @@
|
|
|
71
71
|
"@rollup/plugin-commonjs": "^28.0.2",
|
|
72
72
|
"@rollup/plugin-node-resolve": "^16.0.0",
|
|
73
73
|
"@rollup/plugin-typescript": "^12.1.2",
|
|
74
|
-
"@storybook/addon-
|
|
75
|
-
"@storybook/addon-
|
|
76
|
-
"@storybook/addon-
|
|
77
|
-
"@storybook/addon-
|
|
78
|
-
"@storybook/
|
|
74
|
+
"@storybook/addon-a11y": "10.5.10",
|
|
75
|
+
"@storybook/addon-docs": "10.5.10",
|
|
76
|
+
"@storybook/addon-links": "10.5.10",
|
|
77
|
+
"@storybook/addon-mcp": "0.7.0",
|
|
78
|
+
"@storybook/addon-onboarding": "10.5.10",
|
|
79
|
+
"@storybook/addon-vitest": "10.5.10",
|
|
80
|
+
"@storybook/react-vite": "10.5.10",
|
|
79
81
|
"@storybook/testing-library": "^0.2.2",
|
|
80
82
|
"@svgr/core": "^8.1.0",
|
|
81
83
|
"@svgr/plugin-jsx": "^8.1.0",
|
|
@@ -106,7 +108,7 @@
|
|
|
106
108
|
"eslint-plugin-prettier": "^5.0.0",
|
|
107
109
|
"eslint-plugin-react": "^7.32.2",
|
|
108
110
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
109
|
-
"eslint-plugin-storybook": "10.
|
|
111
|
+
"eslint-plugin-storybook": "10.5.10",
|
|
110
112
|
"framer-motion": "^6.5.1",
|
|
111
113
|
"identity-obj-proxy": "^3.0.0",
|
|
112
114
|
"jest": "~29.0.3",
|
|
@@ -128,13 +130,18 @@
|
|
|
128
130
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
129
131
|
"rollup-plugin-sass": "^1.15.2",
|
|
130
132
|
"sass-loader": "^16.0.5",
|
|
131
|
-
"storybook": "10.
|
|
133
|
+
"storybook": "10.5.10",
|
|
134
|
+
"storybook-addon-pseudo-states": "10.5.10",
|
|
132
135
|
"style-loader": "^2.0.0",
|
|
133
136
|
"stylelint": "^16.25.0",
|
|
134
137
|
"stylelint-config-standard-scss": "^13.0.0",
|
|
135
138
|
"ts-jest": "^29.1.1",
|
|
136
139
|
"tsc-alias": "^1.8.8",
|
|
137
|
-
"typescript": "^5.2.2"
|
|
140
|
+
"typescript": "^5.2.2",
|
|
141
|
+
"vitest": "^4.1.11",
|
|
142
|
+
"playwright": "^1.62.1",
|
|
143
|
+
"@vitest/browser-playwright": "^4.1.11",
|
|
144
|
+
"@vitest/coverage-v8": "^4.1.11"
|
|
138
145
|
},
|
|
139
146
|
"peerDependencies": {
|
|
140
147
|
"@floating-ui/react": "^0.27.19",
|