@x15ventures/x15-ui-library 3.11.4 → 3.13.1
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/cjs/autoGenerated/libraryThemes.js +12 -12
- package/dist/cjs/autoGenerated/libraryThemes.js.map +1 -1
- package/dist/cjs/autoGenerated/libraryThemes.json +12 -12
- package/dist/cjs/components/design/accordion/Accordion.js +16 -7
- package/dist/cjs/components/design/accordion/Accordion.js.map +1 -1
- package/dist/cjs/hooks/InertAttribute.js +28 -0
- package/dist/cjs/hooks/InertAttribute.js.map +1 -0
- package/dist/cjs/hooks/index.js +7 -0
- package/dist/cjs/hooks/index.js.map +1 -1
- package/dist/cjs/images/emails/emailBannerOnboarding1.jpg +0 -0
- package/dist/cjs/images/emails/emailFooterEmailIcon.png +0 -0
- package/dist/cjs/images/emails/emailFooterGlobeIcon.png +0 -0
- package/dist/cjs/package.json +26 -35
- package/dist/cjs/styles/themes/doshii/_buttonMixin.css +0 -0
- package/dist/cjs/types/react.d.js +6 -0
- package/dist/cjs/types/react.d.js.map +1 -0
- package/dist/components/design/accordion/Accordion.d.ts.map +1 -1
- package/dist/esm/autoGenerated/libraryThemes.js +12 -12
- package/dist/esm/autoGenerated/libraryThemes.js.map +1 -1
- package/dist/esm/autoGenerated/libraryThemes.json +12 -12
- package/dist/esm/components/design/accordion/Accordion.js +15 -7
- package/dist/esm/components/design/accordion/Accordion.js.map +1 -1
- package/dist/esm/hooks/InertAttribute.js +21 -0
- package/dist/esm/hooks/InertAttribute.js.map +1 -0
- package/dist/esm/hooks/index.js +1 -0
- package/dist/esm/hooks/index.js.map +1 -1
- package/dist/esm/images/emails/emailBannerOnboarding1.jpg +0 -0
- package/dist/esm/images/emails/emailFooterEmailIcon.png +0 -0
- package/dist/esm/images/emails/emailFooterGlobeIcon.png +0 -0
- package/dist/esm/package.json +26 -35
- package/dist/esm/styles/themes/doshii/_buttonMixin.css +0 -0
- package/dist/esm/types/react.d.js +6 -0
- package/dist/esm/types/react.d.js.map +1 -0
- package/dist/hooks/InertAttribute.d.ts +4 -0
- package/dist/hooks/InertAttribute.d.ts.map +1 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/images/emails/emailBannerOnboarding1.jpg +0 -0
- package/dist/images/emails/emailFooterEmailIcon.png +0 -0
- package/dist/images/emails/emailFooterGlobeIcon.png +0 -0
- package/dist/package.json +26 -35
- package/package.json +26 -31
- package/readme.md +2 -2
- package/dist/styles/index.css +0 -4742
- package/dist/styles/index.css.map +0 -1
- package/dist/styles/index.min.3.11.4.css +0 -1
- package/dist/styles/index.min.3.11.4.css.map +0 -1
- package/dist/styles/index.min.css +0 -1
- package/dist/styles/index.min.css.map +0 -1
- package/dist/styles/storybook.css +0 -394
- package/dist/styles/themes/cba/cba.css +0 -668
- package/dist/styles/themes/cba/cba.css.map +0 -1
- package/dist/styles/themes/cba/cba.min.3.11.4.css +0 -1
- package/dist/styles/themes/cba/cba.min.3.11.4.css.map +0 -1
- package/dist/styles/themes/cba/cba.min.css +0 -1
- package/dist/styles/themes/cba/cba.min.css.map +0 -1
- package/dist/styles/themes/creditSavvy/creditSavvy.css +0 -664
- package/dist/styles/themes/creditSavvy/creditSavvy.css.map +0 -1
- package/dist/styles/themes/creditSavvy/creditSavvy.min.3.11.4.css +0 -1
- package/dist/styles/themes/creditSavvy/creditSavvy.min.3.11.4.css.map +0 -1
- package/dist/styles/themes/creditSavvy/creditSavvy.min.css +0 -1
- package/dist/styles/themes/creditSavvy/creditSavvy.min.css.map +0 -1
- package/dist/styles/themes/doshii/doshii.css +0 -1196
- package/dist/styles/themes/doshii/doshii.css.map +0 -1
- package/dist/styles/themes/doshii/doshii.min.3.11.4.css +0 -1
- package/dist/styles/themes/doshii/doshii.min.3.11.4.css.map +0 -1
- package/dist/styles/themes/doshii/doshii.min.css +0 -1
- package/dist/styles/themes/doshii/doshii.min.css.map +0 -1
- package/dist/styles/themes/homeIn/homeIn.css +0 -1511
- package/dist/styles/themes/homeIn/homeIn.css.map +0 -1
- package/dist/styles/themes/homeIn/homeIn.min.3.11.4.css +0 -1
- package/dist/styles/themes/homeIn/homeIn.min.3.11.4.css.map +0 -1
- package/dist/styles/themes/homeIn/homeIn.min.css +0 -1
- package/dist/styles/themes/homeIn/homeIn.min.css.map +0 -1
- package/dist/styles/themes/icons/fonts/icomoon.svg +0 -553
- package/dist/styles/themes/icons/fonts/icomoon.ttf +0 -0
- package/dist/styles/themes/icons/fonts/icomoon.woff +0 -0
- package/dist/styles/themes/x15Core/x15Core.css +0 -747
- package/dist/styles/themes/x15Core/x15Core.css.map +0 -1
- package/dist/styles/themes/x15Core/x15Core.min.3.11.4.css +0 -1
- package/dist/styles/themes/x15Core/x15Core.min.3.11.4.css.map +0 -1
- package/dist/styles/themes/x15Core/x15Core.min.css +0 -1
- package/dist/styles/themes/x15Core/x15Core.min.css.map +0 -1
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
"map": "index.min.css.map"
|
|
11
11
|
},
|
|
12
12
|
"versioned": {
|
|
13
|
-
"css": "base.min.3.
|
|
14
|
-
"map": "base.min.3.
|
|
13
|
+
"css": "base.min.3.13.1.css",
|
|
14
|
+
"map": "base.min.3.13.1.css.map"
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
17
|
"cba": {
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"map": "cba.min.css.map"
|
|
26
26
|
},
|
|
27
27
|
"versioned": {
|
|
28
|
-
"css": "cba.min.3.
|
|
29
|
-
"map": "cba.min.3.
|
|
28
|
+
"css": "cba.min.3.13.1.css",
|
|
29
|
+
"map": "cba.min.3.13.1.css.map"
|
|
30
30
|
}
|
|
31
31
|
},
|
|
32
32
|
"creditSavvy": {
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
"map": "creditSavvy.min.css.map"
|
|
41
41
|
},
|
|
42
42
|
"versioned": {
|
|
43
|
-
"css": "creditSavvy.min.3.
|
|
44
|
-
"map": "creditSavvy.min.3.
|
|
43
|
+
"css": "creditSavvy.min.3.13.1.css",
|
|
44
|
+
"map": "creditSavvy.min.3.13.1.css.map"
|
|
45
45
|
}
|
|
46
46
|
},
|
|
47
47
|
"doshii": {
|
|
@@ -55,8 +55,8 @@
|
|
|
55
55
|
"map": "doshii.min.css.map"
|
|
56
56
|
},
|
|
57
57
|
"versioned": {
|
|
58
|
-
"css": "doshii.min.3.
|
|
59
|
-
"map": "doshii.min.3.
|
|
58
|
+
"css": "doshii.min.3.13.1.css",
|
|
59
|
+
"map": "doshii.min.3.13.1.css.map"
|
|
60
60
|
}
|
|
61
61
|
},
|
|
62
62
|
"homeIn": {
|
|
@@ -70,8 +70,8 @@
|
|
|
70
70
|
"map": "homeIn.min.css.map"
|
|
71
71
|
},
|
|
72
72
|
"versioned": {
|
|
73
|
-
"css": "homeIn.min.3.
|
|
74
|
-
"map": "homeIn.min.3.
|
|
73
|
+
"css": "homeIn.min.3.13.1.css",
|
|
74
|
+
"map": "homeIn.min.3.13.1.css.map"
|
|
75
75
|
}
|
|
76
76
|
},
|
|
77
77
|
"x15Core": {
|
|
@@ -85,8 +85,8 @@
|
|
|
85
85
|
"map": "x15Core.min.css.map"
|
|
86
86
|
},
|
|
87
87
|
"versioned": {
|
|
88
|
-
"css": "x15Core.min.3.
|
|
89
|
-
"map": "x15Core.min.3.
|
|
88
|
+
"css": "x15Core.min.3.13.1.css",
|
|
89
|
+
"map": "x15Core.min.3.13.1.css.map"
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
/* eslint-disable jsxA11y/no-noninteractive-tabindex, no-unused-vars */
|
|
4
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
4
5
|
import React, { useRef, useState } from 'react';
|
|
5
6
|
import { SvgIcon } from '@x15ventures/x15-ui-library-icons/svgIcon/SvgIcon';
|
|
6
7
|
import { chevronUp, chevronDown } from '@x15ventures/x15-ui-library-icons/iconDefinitions';
|
|
7
8
|
import { Icon } from '../icons/basicIcon/Icon';
|
|
9
|
+
import { useInertAttribute } from '../../../hooks/InertAttribute';
|
|
8
10
|
import './accordion.css';
|
|
9
11
|
export const Accordion = ({
|
|
10
12
|
id,
|
|
@@ -29,6 +31,8 @@ export const Accordion = ({
|
|
|
29
31
|
}) => {
|
|
30
32
|
const [panelIsOpen, setPanelIsOpen] = useState(isOpen || isFixed);
|
|
31
33
|
const accordionControl = useRef(null);
|
|
34
|
+
const accordionContentSection = useRef(null);
|
|
35
|
+
useInertAttribute(accordionContentSection, !panelIsOpen && !isFixed);
|
|
32
36
|
const panelId = id || `accordion_${Date.now()}`;
|
|
33
37
|
const contentId = `${panelId}_content`;
|
|
34
38
|
const controlId = `${panelId}_control`;
|
|
@@ -58,10 +62,10 @@ export const Accordion = ({
|
|
|
58
62
|
'--footer-align-h': horizontalAlignments?.footer || 'left'
|
|
59
63
|
};
|
|
60
64
|
const wrapperCssClass = `
|
|
61
|
-
accordion
|
|
62
|
-
${customCssClass || ''}
|
|
63
|
-
${heightCssClass}
|
|
64
|
-
${panelIsOpen || isFixed ? 'open' : 'closed'}
|
|
65
|
+
accordion
|
|
66
|
+
${customCssClass || ''}
|
|
67
|
+
${heightCssClass}
|
|
68
|
+
${panelIsOpen || isFixed ? 'open' : 'closed'}
|
|
65
69
|
${isFixed ? 'fixed' : ''}
|
|
66
70
|
${isAnimated ? 'animated' : ''}
|
|
67
71
|
${outerBorders ? 'outerBorders' : ''}
|
|
@@ -111,12 +115,16 @@ export const Accordion = ({
|
|
|
111
115
|
className: "sr-only"
|
|
112
116
|
}, "Open and close accordion"), headerButtonCustomLabel || /*#__PURE__*/React.createElement("span", {
|
|
113
117
|
className: "labelText"
|
|
114
|
-
}, heading), panelIsOpen ? /*#__PURE__*/React.createElement(OpenIcon, null) : /*#__PURE__*/React.createElement(CloseIcon, null)))), /*#__PURE__*/React.createElement("section", {
|
|
115
|
-
|
|
118
|
+
}, heading), panelIsOpen ? /*#__PURE__*/React.createElement(OpenIcon, null) : /*#__PURE__*/React.createElement(CloseIcon, null)))), /*#__PURE__*/React.createElement("section", _extends({
|
|
119
|
+
ref: accordionContentSection,
|
|
116
120
|
className: contentCssClass,
|
|
117
121
|
id: contentId,
|
|
118
122
|
"aria-labelledby": controlId
|
|
119
|
-
},
|
|
123
|
+
}, !panelIsOpen && !isFixed ? {
|
|
124
|
+
'aria-hidden': true
|
|
125
|
+
} : {}, {
|
|
126
|
+
tabIndex: restrictHeight && (panelIsOpen || isFixed) ? 0 : undefined
|
|
127
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
120
128
|
className: "sr-only"
|
|
121
129
|
}, "Start of accordion content"), children, footer && /*#__PURE__*/React.createElement("footer", null, footer)));
|
|
122
130
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Accordion.js","names":["React","useRef","useState","SvgIcon","chevronUp","chevronDown","Icon","Accordion","id","heading","children","footer","openIcon","closeIcon","isOpen","isAnimated","isFixed","innerBorders","outerBorders","hasShadow","onChange","customCssClass","restrictHeight","headerButtonCustomLabel","headerButtonCssClass","paddingStyle","horizontalAlignments","panelIsOpen","setPanelIsOpen","accordionControl","panelId","Date","now","contentId","controlId","customSectionHeader","TogglePanelOpenState","newState","heightCssClass","justifyContentMap","left","center","right","alignmentStyle","header","content","wrapperCssClass","headerCssClass","controlCssClass","contentCssClass","OpenIcon","createElement","icon","svgDefinition","CloseIcon","className","style","tabIndex","ref","onClick","type"],"sources":["../../../../../src/components/design/accordion/Accordion.tsx"],"sourcesContent":["'use client';\n\n/* eslint-disable jsxA11y/no-noninteractive-tabindex, no-unused-vars */\n\nimport React, { useRef, useState } from 'react';\nimport { SvgIcon } from '@x15ventures/x15-ui-library-icons/svgIcon/SvgIcon';\nimport { chevronUp, chevronDown } from '@x15ventures/x15-ui-library-icons/iconDefinitions';\n\nimport { Icon } from '../icons/basicIcon/Icon';\n\nimport './accordion.scss';\n\nexport interface AccordionProps {\n id: string;\n isOpen?: boolean;\n isAnimated?: boolean;\n isFixed?: boolean;\n innerBorders?: boolean;\n outerBorders?: boolean;\n hasShadow?: boolean;\n onChange?: (args: boolean) => void;\n openIcon?: string;\n closeIcon?: string;\n heading: string | React.ReactElement;\n footer?: string | React.ReactElement;\n customCssClass?: string;\n restrictHeight?: 'xs' | 's' | 'm' | 'l' | 'xl' | 'auto';\n headerButtonCustomLabel?: string | React.ReactElement;\n headerButtonCssClass?: string;\n paddingStyle?: 'compact' | 'regular' | 'spacious';\n children?: React.ReactNode;\n horizontalAlignments?: {\n header?: 'left' | 'center' | 'right';\n content?: 'left' | 'center' | 'right';\n footer?: 'left' | 'center' | 'right';\n };\n}\n\nexport const Accordion: React.FC<AccordionProps> = (\n {\n id,\n heading,\n children,\n footer,\n openIcon = null,\n closeIcon = null,\n isOpen = true,\n isAnimated = true,\n isFixed = false,\n innerBorders = true,\n outerBorders = true,\n hasShadow = false,\n onChange,\n customCssClass,\n restrictHeight,\n headerButtonCustomLabel,\n headerButtonCssClass,\n paddingStyle = 'regular',\n horizontalAlignments,\n }\n) => {\n const [panelIsOpen, setPanelIsOpen] = useState(isOpen || isFixed);\n const accordionControl = useRef(null);\n\n const panelId = id || `accordion_${ Date.now() }`;\n const contentId = `${ panelId }_content`;\n const controlId = `${ panelId }_control`;\n\n const customSectionHeader = typeof heading !== 'string' && !headerButtonCustomLabel;\n\n const TogglePanelOpenState = () => {\n const newState = !panelIsOpen;\n setPanelIsOpen(newState);\n if (onChange) {\n onChange(newState);\n }\n };\n\n const heightCssClass = restrictHeight ? `accordion_${ restrictHeight }` : '';\n\n\n // map horizontal alignment props to justify-content values for fixed accordions\n const justifyContentMap = {\n left: 'flex-start',\n center: 'center',\n right: 'flex-end',\n };\n\n const alignmentStyle = {\n ...(isFixed && horizontalAlignments?.header\n ? { '--header-align-h': justifyContentMap[horizontalAlignments.header] }\n : { '--header-align-h': horizontalAlignments?.header || 'left' }),\n '--content-align-h': horizontalAlignments?.content || 'left',\n '--footer-align-h': horizontalAlignments?.footer || 'left',\n };\n\n const wrapperCssClass = `\n accordion \n ${ customCssClass || '' } \n ${ heightCssClass } \n ${ panelIsOpen || isFixed ? 'open' : 'closed' } \n ${ isFixed ? 'fixed' : '' }\n ${ isAnimated ? 'animated' : '' }\n ${ outerBorders ? 'outerBorders' : '' }\n ${ paddingStyle ? `padding_${ paddingStyle }` : '' }\n ${ hasShadow ? 'hasShadow' : '' }\n `;\n\n const headerCssClass = `accordionHeader ${ customSectionHeader || isFixed ? 'accordionHeader_custom' : '' } ${ innerBorders ? 'accordionHeader_innerBorders' : '' }`;\n\n const controlCssClass = `accordionControl ${ customCssClass ? `${ customCssClass }_accordionControl` : '' } ${ headerButtonCssClass || '' }`;\n\n const contentCssClass = `accordionContent ${ customCssClass ? `${ customCssClass }_accordionContent` : '' }`;\n\n const OpenIcon = () => {\n if (openIcon) {\n return <Icon icon={ openIcon } />;\n }\n return <SvgIcon svgDefinition={ chevronUp } />;\n };\n\n const CloseIcon = () => {\n if (closeIcon) {\n return <Icon icon={ closeIcon } />;\n }\n return <SvgIcon svgDefinition={ chevronDown } />;\n };\n\n return (\n <section className={ wrapperCssClass } style={ alignmentStyle as React.CSSProperties }>\n <header className={ headerCssClass }>\n {\n customSectionHeader\n ? <div tabIndex={ 0 } className=\"accordionCustomHeading\">{ heading }</div>\n : (\n <h3>\n { isFixed\n ? heading\n : (\n <button\n ref={ accordionControl }\n aria-controls={ contentId }\n aria-expanded={ panelIsOpen }\n id={ controlId }\n onClick={ TogglePanelOpenState }\n type=\"button\"\n className={ controlCssClass }\n >\n <span className=\"sr-only\">Open and close accordion</span>\n {\n headerButtonCustomLabel || <span className=\"labelText\">{ heading }</span>\n }\n {\n panelIsOpen\n ? <OpenIcon />\n : <CloseIcon />\n }\n </button>\n ) }\n </h3>\n )\n }\n </header>\n\n <section tabIndex={ 0 } className={ contentCssClass } id={ contentId } aria-labelledby={ controlId }>\n <span className=\"sr-only\">Start of accordion content</span>\n { children }\n\n { footer\n && (\n <footer>\n { footer }\n </footer>\n ) }\n </section>\n </section>\n );\n};\n\nexport default Accordion;\n"],"mappings":"AAAA,YAAY;;AAEZ;AAEA,OAAOA,KAAK,IAAIC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AAC/C,SAASC,OAAO,QAAQ,mDAAmD;AAC3E,SAASC,SAAS,EAAEC,WAAW,QAAQ,mDAAmD;AAE1F,SAASC,IAAI,QAAQ,yBAAyB;AAE9C,OAAO,kBAAkB;AA4BzB,OAAO,MAAMC,SAAmC,GAAGA,CACjD;EACEC,EAAE;EACFC,OAAO;EACPC,QAAQ;EACRC,MAAM;EACNC,QAAQ,GAAG,IAAI;EACfC,SAAS,GAAG,IAAI;EAChBC,MAAM,GAAG,IAAI;EACbC,UAAU,GAAG,IAAI;EACjBC,OAAO,GAAG,KAAK;EACfC,YAAY,GAAG,IAAI;EACnBC,YAAY,GAAG,IAAI;EACnBC,SAAS,GAAG,KAAK;EACjBC,QAAQ;EACRC,cAAc;EACdC,cAAc;EACdC,uBAAuB;EACvBC,oBAAoB;EACpBC,YAAY,GAAG,SAAS;EACxBC;AACF,CAAC,KACE;EACH,MAAM,CAACC,WAAW,EAAEC,cAAc,CAAC,GAAG1B,QAAQ,CAACY,MAAM,IAAIE,OAAO,CAAC;EACjE,MAAMa,gBAAgB,GAAG5B,MAAM,CAAC,IAAI,CAAC;EAErC,MAAM6B,OAAO,GAAGtB,EAAE,IAAI,aAAcuB,IAAI,CAACC,GAAG,CAAC,CAAC,EAAG;EACjD,MAAMC,SAAS,GAAG,GAAIH,OAAO,UAAW;EACxC,MAAMI,SAAS,GAAG,GAAIJ,OAAO,UAAW;EAExC,MAAMK,mBAAmB,GAAG,OAAO1B,OAAO,KAAK,QAAQ,IAAI,CAACc,uBAAuB;EAEnF,MAAMa,oBAAoB,GAAGA,CAAA,KAAM;IACjC,MAAMC,QAAQ,GAAG,CAACV,WAAW;IAC7BC,cA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AAS,GAAC,0BAA8B,CAAC,EAEvDhC,uBAAuB,iBAAIvB,KAAA,CAAAmD,aAAA;IAAMI,SAAS,EAAC;EAAW,GAAG9C,OAAe,CAAC,EAGzEkB,WAAW,gBACP3B,KAAA,CAAAmD,aAAA,CAACD,QAAQ,MAAE,CAAC,gBACZlD,KAAA,CAAAmD,aAAA,CAACG,SAAS,MAAE,CAEZ,CAEV,CAGJ,CAAC,eAETtD,KAAA,CAAAmD,aAAA;IAASM,QAAQ,EAAG,CAAG;IAACF,SAAS,EAAGN,eAAiB;IAACzC,EAAE,EAAGyB,SAAW;IAAC,mBAAkBC;EAAW,gBAClGlC,KAAA,CAAAmD,aAAA;IAAMI,SAAS,EAAC;EAAS,GAAC,4BAAgC,CAAC,EACzD7C,QAAQ,EAERC,MAAM,iBAEJX,KAAA,CAAAmD,aAAA,iBACIxC,MACI,CAEL,CACF,CAAC;AAEd,CAAC;AAED,eAAeJ,SAAS","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"Accordion.js","names":["_extends","React","useRef","useState","SvgIcon","chevronUp","chevronDown","Icon","useInertAttribute","Accordion","id","heading","children","footer","openIcon","closeIcon","isOpen","isAnimated","isFixed","innerBorders","outerBorders","hasShadow","onChange","customCssClass","restrictHeight","headerButtonCustomLabel","headerButtonCssClass","paddingStyle","horizontalAlignments","panelIsOpen","setPanelIsOpen","accordionControl","accordionContentSection","panelId","Date","now","contentId","controlId","customSectionHeader","TogglePanelOpenState","newState","heightCssClass","justifyContentMap","left","center","right","alignmentStyle","header","content","wrapperCssClass","headerCssClass","controlCssClass","contentCssClass","OpenIcon","createElement","icon","svgDefinition","CloseIcon","className","style","tabIndex","ref","onClick","type","undefined"],"sources":["../../../../../src/components/design/accordion/Accordion.tsx"],"sourcesContent":["'use client';\n\n/* eslint-disable jsxA11y/no-noninteractive-tabindex, no-unused-vars */\n\nimport React, { useEffect, useRef, useState } from 'react';\nimport { SvgIcon } from '@x15ventures/x15-ui-library-icons/svgIcon/SvgIcon';\nimport { chevronUp, chevronDown } from '@x15ventures/x15-ui-library-icons/iconDefinitions';\n\nimport { Icon } from '../icons/basicIcon/Icon';\nimport { useInertAttribute } from '../../../hooks/InertAttribute';\n\nimport './accordion.scss';\n\nexport interface AccordionProps {\n id: string;\n isOpen?: boolean;\n isAnimated?: boolean;\n isFixed?: boolean;\n innerBorders?: boolean;\n outerBorders?: boolean;\n hasShadow?: boolean;\n onChange?: (args: boolean) => void;\n openIcon?: string;\n closeIcon?: string;\n heading: string | React.ReactElement;\n footer?: string | React.ReactElement;\n customCssClass?: string;\n restrictHeight?: 'xs' | 's' | 'm' | 'l' | 'xl' | 'auto';\n headerButtonCustomLabel?: string | React.ReactElement;\n headerButtonCssClass?: string;\n paddingStyle?: 'compact' | 'regular' | 'spacious';\n children?: React.ReactNode;\n horizontalAlignments?: {\n header?: 'left' | 'center' | 'right';\n content?: 'left' | 'center' | 'right';\n footer?: 'left' | 'center' | 'right';\n };\n}\n\nexport const Accordion: React.FC<AccordionProps> = (\n {\n id,\n heading,\n children,\n footer,\n openIcon = null,\n closeIcon = null,\n isOpen = true,\n isAnimated = true,\n isFixed = false,\n innerBorders = true,\n outerBorders = true,\n hasShadow = false,\n onChange,\n customCssClass,\n restrictHeight,\n headerButtonCustomLabel,\n headerButtonCssClass,\n paddingStyle = 'regular',\n horizontalAlignments,\n }\n) => {\n const [panelIsOpen, setPanelIsOpen] = useState(isOpen || isFixed);\n const accordionControl = useRef(null);\n const accordionContentSection = useRef<HTMLElement>(null);\n\n useInertAttribute(accordionContentSection, !panelIsOpen && !isFixed);\n\n const panelId = id || `accordion_${ Date.now() }`;\n const contentId = `${ panelId }_content`;\n const controlId = `${ panelId }_control`;\n\n const customSectionHeader = typeof heading !== 'string' && !headerButtonCustomLabel;\n\n const TogglePanelOpenState = () => {\n const newState = !panelIsOpen;\n setPanelIsOpen(newState);\n if (onChange) {\n onChange(newState);\n }\n };\n\n const heightCssClass = restrictHeight ? `accordion_${ restrictHeight }` : '';\n\n // map horizontal alignment props to justify-content values for fixed accordions\n const justifyContentMap = {\n left: 'flex-start',\n center: 'center',\n right: 'flex-end',\n };\n\n const alignmentStyle = {\n ...(isFixed && horizontalAlignments?.header\n ? { '--header-align-h': justifyContentMap[horizontalAlignments.header] }\n : { '--header-align-h': horizontalAlignments?.header || 'left' }),\n '--content-align-h': horizontalAlignments?.content || 'left',\n '--footer-align-h': horizontalAlignments?.footer || 'left',\n };\n\n const wrapperCssClass = `\n accordion\n ${ customCssClass || '' }\n ${ heightCssClass }\n ${ panelIsOpen || isFixed ? 'open' : 'closed' }\n ${ isFixed ? 'fixed' : '' }\n ${ isAnimated ? 'animated' : '' }\n ${ outerBorders ? 'outerBorders' : '' }\n ${ paddingStyle ? `padding_${ paddingStyle }` : '' }\n ${ hasShadow ? 'hasShadow' : '' }\n `;\n\n const headerCssClass = `accordionHeader ${ customSectionHeader || isFixed ? 'accordionHeader_custom' : '' } ${ innerBorders ? 'accordionHeader_innerBorders' : '' }`;\n\n const controlCssClass = `accordionControl ${ customCssClass ? `${ customCssClass }_accordionControl` : '' } ${ headerButtonCssClass || '' }`;\n\n const contentCssClass = `accordionContent ${ customCssClass ? `${ customCssClass }_accordionContent` : '' }`;\n\n const OpenIcon = () => {\n if (openIcon) {\n return <Icon icon={ openIcon } />;\n }\n return <SvgIcon svgDefinition={ chevronUp } />;\n };\n\n const CloseIcon = () => {\n if (closeIcon) {\n return <Icon icon={ closeIcon } />;\n }\n return <SvgIcon svgDefinition={ chevronDown } />;\n };\n\n return (\n <section className={ wrapperCssClass } style={ alignmentStyle as React.CSSProperties }>\n <header className={ headerCssClass }>\n {\n customSectionHeader\n ? <div tabIndex={ 0 } className=\"accordionCustomHeading\">{ heading }</div>\n : (\n <h3>\n { isFixed\n ? heading\n : (\n <button\n ref={ accordionControl }\n aria-controls={ contentId }\n aria-expanded={ panelIsOpen }\n id={ controlId }\n onClick={ TogglePanelOpenState }\n type=\"button\"\n className={ controlCssClass }\n >\n <span className=\"sr-only\">Open and close accordion</span>\n {\n headerButtonCustomLabel || <span className=\"labelText\">{ heading }</span>\n }\n {\n panelIsOpen\n ? <OpenIcon />\n : <CloseIcon />\n }\n </button>\n ) }\n </h3>\n )\n }\n </header>\n\n <section\n ref={ accordionContentSection }\n className={ contentCssClass }\n id={ contentId }\n aria-labelledby={ controlId }\n { ...(!panelIsOpen && !isFixed ? {\n 'aria-hidden': true\n } : {}) }\n tabIndex={ restrictHeight && (panelIsOpen || isFixed) ? 0 : undefined }\n >\n <span className=\"sr-only\">Start of accordion content</span>\n { children }\n\n { footer\n && (\n <footer>\n { footer }\n </footer>\n ) }\n </section>\n </section>\n );\n};\n\nexport default Accordion;\n"],"mappings":"AAAA,YAAY;;AAEZ;AAAA,OAAAA,QAAA;AAEA,OAAOC,KAAK,IAAeC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AAC1D,SAASC,OAAO,QAAQ,mDAAmD;AAC3E,SAASC,SAAS,EAAEC,WAAW,QAAQ,mDAAmD;AAE1F,SAASC,IAAI,QAAQ,yBAAyB;AAC9C,SAASC,iBAAiB,QAAQ,+BAA+B;AAEjE,OAAO,kBAAkB;AA4BzB,OAAO,MAAMC,SAAmC,GAAGA,CACjD;EACEC,EAAE;EACFC,OAAO;EACPC,QAAQ;EACRC,MAAM;EACNC,QAAQ,GAAG,IAAI;EACfC,SAAS,GAAG,IAAI;EAChBC,MAAM,GAAG,IAAI;EACbC,UAAU,GAAG,IAAI;EACjBC,OAAO,GAAG,KAAK;EACfC,YAAY,GAAG,IAAI;EACnBC,YAAY,GAAG,IAAI;EACnBC,SAAS,GAAG,KAAK;EACjBC,QAAQ;EACRC,cAAc;EACdC,cAAc;EACdC,uBAAuB;EACvBC,oBAAoB;EACpBC,YAAY,GAAG,SAAS;EACxBC;AACF,CAAC,KACE;EACH,MAAM,CAACC,WAAW,EAAEC,cAAc,CAAC,GAAG3B,QAAQ,CAACa,MAAM,IAAIE,OAAO,CAAC;EACjE,MAAMa,gBAAgB,GAAG7B,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BACIzC,MACI,CAEL,CACF,CAAC;AAEd,CAAC;AAED,eAAeJ,SAAS","ignoreList":[]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
export const useInertAttribute = (elementRef, enabled) => {
|
|
3
|
+
useEffect(() => {
|
|
4
|
+
const domElement = elementRef.current;
|
|
5
|
+
if (!domElement) return;
|
|
6
|
+
|
|
7
|
+
// Set DOM property (cross React-version safe)
|
|
8
|
+
if ('inert' in domElement) {
|
|
9
|
+
domElement.inert = enabled;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// Sync attribute (SSR + consistency)
|
|
13
|
+
if (enabled) {
|
|
14
|
+
domElement.setAttribute('inert', '');
|
|
15
|
+
} else {
|
|
16
|
+
domElement.removeAttribute('inert');
|
|
17
|
+
}
|
|
18
|
+
}, [enabled]);
|
|
19
|
+
};
|
|
20
|
+
export default useInertAttribute;
|
|
21
|
+
//# sourceMappingURL=InertAttribute.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InertAttribute.js","names":["useEffect","useInertAttribute","elementRef","enabled","domElement","current","inert","setAttribute","removeAttribute"],"sources":["../../../src/hooks/InertAttribute.ts"],"sourcesContent":["import { RefObject, useEffect } from 'react';\n\ntype InertElement = HTMLElement & { inert?: boolean };\n\nexport const useInertAttribute = <T extends HTMLElement>(\n elementRef: RefObject<T | null>,\n enabled: boolean\n) => {\n useEffect(() => {\n const domElement = elementRef.current as InertElement | null;\n if (!domElement) return;\n\n // Set DOM property (cross React-version safe)\n if ('inert' in domElement) {\n domElement.inert = enabled;\n }\n\n // Sync attribute (SSR + consistency)\n if (enabled) {\n domElement.setAttribute('inert', '');\n } else {\n domElement.removeAttribute('inert');\n }\n }, [enabled]);\n};\n\nexport default useInertAttribute;"],"mappings":"AAAA,SAAoBA,SAAS,QAAQ,OAAO;AAI5C,OAAO,MAAMC,iBAAiB,GAAGA,CAC/BC,UAA+B,EAC/BC,OAAgB,KACb;EACHH,SAAS,CAAC,MAAM;IACd,MAAMI,UAAU,GAAGF,UAAU,CAACG,OAA8B;IAC5D,IAAI,CAACD,UAAU,EAAE;;IAEjB;IACA,IAAI,OAAO,IAAIA,UAAU,EAAE;MACzBA,UAAU,CAACE,KAAK,GAAGH,OAAO;IAC5B;;IAEA;IACA,IAAIA,OAAO,EAAE;MACXC,UAAU,CAACG,YAAY,CAAC,OAAO,EAAE,EAAE,CAAC;IACtC,CAAC,MAAM;MACLH,UAAU,CAACI,eAAe,CAAC,OAAO,CAAC;IACrC;EACF,CAAC,EAAE,CAACL,OAAO,CAAC,CAAC;AACf,CAAC;AAED,eAAeF,iBAAiB","ignoreList":[]}
|
package/dist/esm/hooks/index.js
CHANGED
|
@@ -8,4 +8,5 @@ export { useTabbableInputGroup } from './TabbableInputGroup';
|
|
|
8
8
|
export { useDialogOverlay } from './DialogOverlay';
|
|
9
9
|
export { useEllipsisBookends } from './EllipsisBookends';
|
|
10
10
|
export { useFocusTrap } from './FocusTrap';
|
|
11
|
+
export { useInertAttribute } from './InertAttribute';
|
|
11
12
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["useOnClickOutside","usePopupKeys","useOnEdgeProximityDetect","useFirstCapital","useTabbableInputGroup","useDialogOverlay","useEllipsisBookends","useFocusTrap"],"sources":["../../../src/hooks/index.tsx"],"sourcesContent":["'use client';\n\nexport { useOnClickOutside } from './ClickOutside';\nexport { usePopupKeys } from './PopupKeys';\nexport { useOnEdgeProximityDetect } from './EdgeProximityDetect';\nexport { useFirstCapital } from './Strings';\nexport { useTabbableInputGroup } from './TabbableInputGroup';\nexport { useDialogOverlay } from './DialogOverlay';\nexport { useEllipsisBookends } from './EllipsisBookends';\nexport { useFocusTrap } from './FocusTrap';"],"mappings":"AAAA,YAAY;;AAEZ,SAASA,iBAAiB,QAAQ,gBAAgB;AAClD,SAASC,YAAY,QAAQ,aAAa;AAC1C,SAASC,wBAAwB,QAAQ,uBAAuB;AAChE,SAASC,eAAe,QAAQ,WAAW;AAC3C,SAASC,qBAAqB,QAAQ,sBAAsB;AAC5D,SAASC,gBAAgB,QAAQ,iBAAiB;AAClD,SAASC,mBAAmB,QAAQ,oBAAoB;AACxD,SAASC,YAAY,QAAQ,aAAa","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":["useOnClickOutside","usePopupKeys","useOnEdgeProximityDetect","useFirstCapital","useTabbableInputGroup","useDialogOverlay","useEllipsisBookends","useFocusTrap","useInertAttribute"],"sources":["../../../src/hooks/index.tsx"],"sourcesContent":["'use client';\n\nexport { useOnClickOutside } from './ClickOutside';\nexport { usePopupKeys } from './PopupKeys';\nexport { useOnEdgeProximityDetect } from './EdgeProximityDetect';\nexport { useFirstCapital } from './Strings';\nexport { useTabbableInputGroup } from './TabbableInputGroup';\nexport { useDialogOverlay } from './DialogOverlay';\nexport { useEllipsisBookends } from './EllipsisBookends';\nexport { useFocusTrap } from './FocusTrap';\nexport { useInertAttribute } from './InertAttribute';"],"mappings":"AAAA,YAAY;;AAEZ,SAASA,iBAAiB,QAAQ,gBAAgB;AAClD,SAASC,YAAY,QAAQ,aAAa;AAC1C,SAASC,wBAAwB,QAAQ,uBAAuB;AAChE,SAASC,eAAe,QAAQ,WAAW;AAC3C,SAASC,qBAAqB,QAAQ,sBAAsB;AAC5D,SAASC,gBAAgB,QAAQ,iBAAiB;AAClD,SAASC,mBAAmB,QAAQ,oBAAoB;AACxD,SAASC,YAAY,QAAQ,aAAa;AAC1C,SAASC,iBAAiB,QAAQ,kBAAkB","ignoreList":[]}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/dist/esm/package.json
CHANGED
|
@@ -137,12 +137,8 @@
|
|
|
137
137
|
"files": [
|
|
138
138
|
"dist"
|
|
139
139
|
],
|
|
140
|
-
"version": "3.
|
|
140
|
+
"version": "3.13.0",
|
|
141
141
|
"packageManager": "pnpm@10.11.0",
|
|
142
|
-
"publishConfig": {
|
|
143
|
-
"registry": "https://npm.pkg.github.com/",
|
|
144
|
-
"tag": "latest"
|
|
145
|
-
},
|
|
146
142
|
"repository": {
|
|
147
143
|
"type": "git",
|
|
148
144
|
"url": "https://github.com/x15ventures/x15-ui-library.git"
|
|
@@ -154,13 +150,13 @@
|
|
|
154
150
|
"watch:react": "nodemon --watch src --ext ts,tsx --exec 'pnpm build:react'",
|
|
155
151
|
"watch:sass": "nodemon --watch src/styles --ext scss --exec 'pnpm build:sass'",
|
|
156
152
|
"build": "",
|
|
157
|
-
"build:cicd": "pnpm build:sass && pnpm build:react && pnpm build:types && pnpm build:sass",
|
|
153
|
+
"build:cicd": "pnpm build:sass && pnpm build:react && pnpm build:types && pnpm build:sass && pnpm storybook:styles",
|
|
158
154
|
"build:local": "pnpm build:react && pnpm storybook:build",
|
|
159
155
|
"build:react": "run-func buildLibrary.js buildLibrary",
|
|
160
|
-
"build:sass": "run-func sass.utilities.js buildSassFiles
|
|
156
|
+
"build:sass": "run-func sass.utilities.js buildSassFiles",
|
|
161
157
|
"build:static": "pnpm build:react && pnpm build:sass",
|
|
162
158
|
"build:types": "npx tsc --build tsconfig.lib.json --force",
|
|
163
|
-
"build:ai:docs": "run-func aiTools/scripts/componentAIDocExtractor.js generateDocumentation",
|
|
159
|
+
"build:ai:docs": "run-func aiTools/scripts/componentAIDocExtractor.js generateDocumentation && pnpm storybook:build && mkdir -p ./aiTools/storybookDocs && cp -R ./storybook-static/* ./aiTools/storybookDocs",
|
|
164
160
|
"build:ai:library": "run-func buildLibrary.js makeAIReferenceFiles",
|
|
165
161
|
"build:ai:styles": "node aiTools/scripts/componentAICssExtractor.js",
|
|
166
162
|
"build:ai:styles:reference": "node aiTools/scripts/buildAiStylesReference.js",
|
|
@@ -179,6 +175,7 @@
|
|
|
179
175
|
"dependencies": {
|
|
180
176
|
"@hookform/error-message": "^2.0.1",
|
|
181
177
|
"@semantic-release/exec": "^7.0.3",
|
|
178
|
+
"@x15stack/aws": "^1.6.5",
|
|
182
179
|
"@x15ventures/x15-ui-library-icons": "^1.0.4",
|
|
183
180
|
"babel-plugin-transform-imports": "^2.0.0",
|
|
184
181
|
"html-react-parser": "^5.1.16",
|
|
@@ -210,6 +207,8 @@
|
|
|
210
207
|
"@babel/preset-react": "^7",
|
|
211
208
|
"@babel/preset-typescript": "^7",
|
|
212
209
|
"@babel/runtime": "^7.26.10",
|
|
210
|
+
"@commitlint/cli": "^20.5.0",
|
|
211
|
+
"@commitlint/config-conventional": "^20.5.0",
|
|
213
212
|
"@eslint/js": "^9.38.0",
|
|
214
213
|
"@jest/globals": "^29.7.0",
|
|
215
214
|
"@jest/types": "^29.6.3",
|
|
@@ -257,6 +256,7 @@
|
|
|
257
256
|
"babel-loader": "^9.1.3",
|
|
258
257
|
"babel-plugin-macros": "^3.1.0",
|
|
259
258
|
"chromatic": "^11.10.1",
|
|
259
|
+
"commitlint": "^20.5.0",
|
|
260
260
|
"copy-webpack-plugin": "^12.0.2",
|
|
261
261
|
"cors": "^2.8.5",
|
|
262
262
|
"cross-env": "^7.0.3",
|
|
@@ -276,11 +276,12 @@
|
|
|
276
276
|
"file-loader": "^6.2.0",
|
|
277
277
|
"fs": "0.0.1-security",
|
|
278
278
|
"fs-extra": "^11.3.0",
|
|
279
|
-
"glob": "^
|
|
279
|
+
"glob": "^13.0.6",
|
|
280
280
|
"globals": "^15.14.0",
|
|
281
281
|
"jest": "^30.2.0",
|
|
282
282
|
"jest-environment-jsdom": "^29.7.0",
|
|
283
283
|
"lefthook": "^1.11.2",
|
|
284
|
+
"minimatch": "^10.2.4",
|
|
284
285
|
"nodemon": "^3.1.4",
|
|
285
286
|
"npm-run-all": "^4.1.5",
|
|
286
287
|
"null-loader": "^4.0.1",
|
|
@@ -304,32 +305,22 @@
|
|
|
304
305
|
},
|
|
305
306
|
"pnpm": {
|
|
306
307
|
"overrides": {
|
|
307
|
-
"
|
|
308
|
-
"
|
|
309
|
-
"
|
|
310
|
-
"
|
|
311
|
-
"
|
|
312
|
-
"
|
|
313
|
-
"
|
|
314
|
-
"
|
|
315
|
-
"
|
|
316
|
-
"
|
|
317
|
-
"
|
|
318
|
-
"
|
|
319
|
-
"
|
|
320
|
-
"
|
|
321
|
-
"
|
|
322
|
-
"
|
|
323
|
-
"brace-expansion@>=1.0.0 <=1.1.11": ">=1.1.12",
|
|
324
|
-
"brace-expansion@>=2.0.0 <=2.0.1": ">=2.0.2",
|
|
325
|
-
"minimatch>brace-expansion": "2.0.2",
|
|
326
|
-
"js-yaml": ">=4.1.1",
|
|
327
|
-
"glob": ">=11.1.0",
|
|
328
|
-
"mdast-util-to-hast@>=13.0.0 <13.2.1": ">=13.2.1",
|
|
329
|
-
"qs@<6.14.1": ">=6.14.1",
|
|
330
|
-
"lodash-es": ">=4.17.23",
|
|
331
|
-
"lodash": ">=4.17.23",
|
|
332
|
-
"undici": ">=7.18.2"
|
|
308
|
+
"@tootallnate/once@<3.0.1": ">=3.0.1",
|
|
309
|
+
"brace-expansion": ">=5.0.5",
|
|
310
|
+
"flatted": ">=3.4.2",
|
|
311
|
+
"flatted@<3.4.0": ">=3.4.0",
|
|
312
|
+
"handlebars": ">=4.7.9",
|
|
313
|
+
"immutable@>=5.0.0 <5.1.5": ">=5.1.5",
|
|
314
|
+
"minimatch": ">=9.0.7",
|
|
315
|
+
"path-to-regexp": ">=8.4.0",
|
|
316
|
+
"picomatch": ">=4.0.4",
|
|
317
|
+
"qs": ">=6.14.2",
|
|
318
|
+
"rollup": ">=4.59.0",
|
|
319
|
+
"serialize-javascript": ">=7.0.3",
|
|
320
|
+
"storybook": ">=10.2.10",
|
|
321
|
+
"undici": ">=7.24.0",
|
|
322
|
+
"webpack": ">=5.104.1",
|
|
323
|
+
"yaml": ">=1.10.3"
|
|
333
324
|
},
|
|
334
325
|
"auditConfig": {
|
|
335
326
|
"ignoreCves": [
|
|
File without changes
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// Extend React types to include the inert attribute for HTML elements
|
|
2
|
+
// The inert attribute is a standard HTML attribute supported in modern browsers
|
|
3
|
+
// but is not included in React 18's type definitions (added in React 19)
|
|
4
|
+
|
|
5
|
+
export {};
|
|
6
|
+
//# sourceMappingURL=react.d.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react.d.js","names":[],"sources":["../../../src/types/react.d.ts"],"sourcesContent":["// Extend React types to include the inert attribute for HTML elements\n// The inert attribute is a standard HTML attribute supported in modern browsers\n// but is not included in React 18's type definitions (added in React 19)\ndeclare module 'react' {\n // eslint-disable-next-line no-unused-vars\n interface HTMLAttributes<T> {\n /**\n * The inert attribute is a boolean attribute that indicates that the element\n * and all its descendants should be made non-interactive and invisible to\n * assistive technologies (screen readers).\n *\n * When inert is true, the element:\n * - Is removed from the tab order\n * - Cannot be focused\n * - Is hidden from screen readers\n * - Cannot have any interactions\n *\n * Supported in all modern browsers (Chrome 102+, Firefox 112+, Safari 15.5+, Edge 102+)\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert\n */\n inert?: boolean;\n }\n}\n\nexport {};\n"],"mappings":"AAAA;AACA;AACA;;AAuBA","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InertAttribute.d.ts","sourceRoot":"","sources":["../../src/hooks/InertAttribute.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAa,MAAM,OAAO,CAAC;AAI7C,eAAO,MAAM,iBAAiB,GAAI,CAAC,SAAS,WAAW,cACzC,SAAS,CAAC,CAAC,GAAG,IAAI,CAAC,WACtB,OAAO,SAkBjB,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -6,4 +6,5 @@ export { useTabbableInputGroup } from './TabbableInputGroup';
|
|
|
6
6
|
export { useDialogOverlay } from './DialogOverlay';
|
|
7
7
|
export { useEllipsisBookends } from './EllipsisBookends';
|
|
8
8
|
export { useFocusTrap } from './FocusTrap';
|
|
9
|
+
export { useInertAttribute } from './InertAttribute';
|
|
9
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC"}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/dist/package.json
CHANGED
|
@@ -137,12 +137,8 @@
|
|
|
137
137
|
"files": [
|
|
138
138
|
"dist"
|
|
139
139
|
],
|
|
140
|
-
"version": "3.
|
|
140
|
+
"version": "3.13.0",
|
|
141
141
|
"packageManager": "pnpm@10.11.0",
|
|
142
|
-
"publishConfig": {
|
|
143
|
-
"registry": "https://npm.pkg.github.com/",
|
|
144
|
-
"tag": "latest"
|
|
145
|
-
},
|
|
146
142
|
"repository": {
|
|
147
143
|
"type": "git",
|
|
148
144
|
"url": "https://github.com/x15ventures/x15-ui-library.git"
|
|
@@ -154,13 +150,13 @@
|
|
|
154
150
|
"watch:react": "nodemon --watch src --ext ts,tsx --exec 'pnpm build:react'",
|
|
155
151
|
"watch:sass": "nodemon --watch src/styles --ext scss --exec 'pnpm build:sass'",
|
|
156
152
|
"build": "",
|
|
157
|
-
"build:cicd": "pnpm build:sass && pnpm build:react && pnpm build:types && pnpm build:sass",
|
|
153
|
+
"build:cicd": "pnpm build:sass && pnpm build:react && pnpm build:types && pnpm build:sass && pnpm storybook:styles",
|
|
158
154
|
"build:local": "pnpm build:react && pnpm storybook:build",
|
|
159
155
|
"build:react": "run-func buildLibrary.js buildLibrary",
|
|
160
|
-
"build:sass": "run-func sass.utilities.js buildSassFiles
|
|
156
|
+
"build:sass": "run-func sass.utilities.js buildSassFiles",
|
|
161
157
|
"build:static": "pnpm build:react && pnpm build:sass",
|
|
162
158
|
"build:types": "npx tsc --build tsconfig.lib.json --force",
|
|
163
|
-
"build:ai:docs": "run-func aiTools/scripts/componentAIDocExtractor.js generateDocumentation",
|
|
159
|
+
"build:ai:docs": "run-func aiTools/scripts/componentAIDocExtractor.js generateDocumentation && pnpm storybook:build && mkdir -p ./aiTools/storybookDocs && cp -R ./storybook-static/* ./aiTools/storybookDocs",
|
|
164
160
|
"build:ai:library": "run-func buildLibrary.js makeAIReferenceFiles",
|
|
165
161
|
"build:ai:styles": "node aiTools/scripts/componentAICssExtractor.js",
|
|
166
162
|
"build:ai:styles:reference": "node aiTools/scripts/buildAiStylesReference.js",
|
|
@@ -179,6 +175,7 @@
|
|
|
179
175
|
"dependencies": {
|
|
180
176
|
"@hookform/error-message": "^2.0.1",
|
|
181
177
|
"@semantic-release/exec": "^7.0.3",
|
|
178
|
+
"@x15stack/aws": "^1.6.5",
|
|
182
179
|
"@x15ventures/x15-ui-library-icons": "^1.0.4",
|
|
183
180
|
"babel-plugin-transform-imports": "^2.0.0",
|
|
184
181
|
"html-react-parser": "^5.1.16",
|
|
@@ -210,6 +207,8 @@
|
|
|
210
207
|
"@babel/preset-react": "^7",
|
|
211
208
|
"@babel/preset-typescript": "^7",
|
|
212
209
|
"@babel/runtime": "^7.26.10",
|
|
210
|
+
"@commitlint/cli": "^20.5.0",
|
|
211
|
+
"@commitlint/config-conventional": "^20.5.0",
|
|
213
212
|
"@eslint/js": "^9.38.0",
|
|
214
213
|
"@jest/globals": "^29.7.0",
|
|
215
214
|
"@jest/types": "^29.6.3",
|
|
@@ -257,6 +256,7 @@
|
|
|
257
256
|
"babel-loader": "^9.1.3",
|
|
258
257
|
"babel-plugin-macros": "^3.1.0",
|
|
259
258
|
"chromatic": "^11.10.1",
|
|
259
|
+
"commitlint": "^20.5.0",
|
|
260
260
|
"copy-webpack-plugin": "^12.0.2",
|
|
261
261
|
"cors": "^2.8.5",
|
|
262
262
|
"cross-env": "^7.0.3",
|
|
@@ -276,11 +276,12 @@
|
|
|
276
276
|
"file-loader": "^6.2.0",
|
|
277
277
|
"fs": "0.0.1-security",
|
|
278
278
|
"fs-extra": "^11.3.0",
|
|
279
|
-
"glob": "^
|
|
279
|
+
"glob": "^13.0.6",
|
|
280
280
|
"globals": "^15.14.0",
|
|
281
281
|
"jest": "^30.2.0",
|
|
282
282
|
"jest-environment-jsdom": "^29.7.0",
|
|
283
283
|
"lefthook": "^1.11.2",
|
|
284
|
+
"minimatch": "^10.2.4",
|
|
284
285
|
"nodemon": "^3.1.4",
|
|
285
286
|
"npm-run-all": "^4.1.5",
|
|
286
287
|
"null-loader": "^4.0.1",
|
|
@@ -304,32 +305,22 @@
|
|
|
304
305
|
},
|
|
305
306
|
"pnpm": {
|
|
306
307
|
"overrides": {
|
|
307
|
-
"
|
|
308
|
-
"
|
|
309
|
-
"
|
|
310
|
-
"
|
|
311
|
-
"
|
|
312
|
-
"
|
|
313
|
-
"
|
|
314
|
-
"
|
|
315
|
-
"
|
|
316
|
-
"
|
|
317
|
-
"
|
|
318
|
-
"
|
|
319
|
-
"
|
|
320
|
-
"
|
|
321
|
-
"
|
|
322
|
-
"
|
|
323
|
-
"brace-expansion@>=1.0.0 <=1.1.11": ">=1.1.12",
|
|
324
|
-
"brace-expansion@>=2.0.0 <=2.0.1": ">=2.0.2",
|
|
325
|
-
"minimatch>brace-expansion": "2.0.2",
|
|
326
|
-
"js-yaml": ">=4.1.1",
|
|
327
|
-
"glob": ">=11.1.0",
|
|
328
|
-
"mdast-util-to-hast@>=13.0.0 <13.2.1": ">=13.2.1",
|
|
329
|
-
"qs@<6.14.1": ">=6.14.1",
|
|
330
|
-
"lodash-es": ">=4.17.23",
|
|
331
|
-
"lodash": ">=4.17.23",
|
|
332
|
-
"undici": ">=7.18.2"
|
|
308
|
+
"@tootallnate/once@<3.0.1": ">=3.0.1",
|
|
309
|
+
"brace-expansion": ">=5.0.5",
|
|
310
|
+
"flatted": ">=3.4.2",
|
|
311
|
+
"flatted@<3.4.0": ">=3.4.0",
|
|
312
|
+
"handlebars": ">=4.7.9",
|
|
313
|
+
"immutable@>=5.0.0 <5.1.5": ">=5.1.5",
|
|
314
|
+
"minimatch": ">=9.0.7",
|
|
315
|
+
"path-to-regexp": ">=8.4.0",
|
|
316
|
+
"picomatch": ">=4.0.4",
|
|
317
|
+
"qs": ">=6.14.2",
|
|
318
|
+
"rollup": ">=4.59.0",
|
|
319
|
+
"serialize-javascript": ">=7.0.3",
|
|
320
|
+
"storybook": ">=10.2.10",
|
|
321
|
+
"undici": ">=7.24.0",
|
|
322
|
+
"webpack": ">=5.104.1",
|
|
323
|
+
"yaml": ">=1.10.3"
|
|
333
324
|
},
|
|
334
325
|
"auditConfig": {
|
|
335
326
|
"ignoreCves": [
|