@economic/taco 1.23.0 → 1.24.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (134) hide show
  1. package/dist/components/Header/Header.d.ts +28 -0
  2. package/dist/components/Header/components/AgreementSelector.d.ts +18 -0
  3. package/dist/components/Header/components/Agreements/AgreementDetails.d.ts +20 -0
  4. package/dist/components/Header/components/Button.d.ts +11 -0
  5. package/dist/components/Header/components/Link.d.ts +21 -0
  6. package/dist/components/Header/components/Logo.d.ts +3 -0
  7. package/dist/components/Header/components/MenuButton.d.ts +5 -0
  8. package/dist/components/Header/components/PrimaryNavigation.d.ts +3 -0
  9. package/dist/components/Header/components/SecondaryNavigation.d.ts +3 -0
  10. package/dist/components/Layout/Layout.d.ts +16 -0
  11. package/dist/components/Layout/components/Content.d.ts +3 -0
  12. package/dist/components/Layout/components/Context.d.ts +6 -0
  13. package/dist/components/Layout/components/Page.d.ts +3 -0
  14. package/dist/components/Layout/components/Sidebar.d.ts +3 -0
  15. package/dist/components/Layout/components/Top.d.ts +7 -0
  16. package/dist/components/Navigation2/Navigation2.d.ts +17 -0
  17. package/dist/components/Navigation2/components/Content.d.ts +3 -0
  18. package/dist/components/Navigation2/components/Group.d.ts +9 -0
  19. package/dist/components/Navigation2/components/Link.d.ts +24 -0
  20. package/dist/components/Navigation2/components/Section.d.ts +7 -0
  21. package/dist/components/Provider/Localization.d.ts +27 -17
  22. package/dist/esm/packages/taco/src/components/Card/Card.js +1 -1
  23. package/dist/esm/packages/taco/src/components/Card/Card.js.map +1 -1
  24. package/dist/esm/packages/taco/src/components/Header/Header.js +30 -0
  25. package/dist/esm/packages/taco/src/components/Header/Header.js.map +1 -0
  26. package/dist/esm/packages/taco/src/components/Header/components/AgreementSelector.js +134 -0
  27. package/dist/esm/packages/taco/src/components/Header/components/AgreementSelector.js.map +1 -0
  28. package/dist/esm/packages/taco/src/components/Header/components/Agreements/AgreementDetails.js +73 -0
  29. package/dist/esm/packages/taco/src/components/Header/components/Agreements/AgreementDetails.js.map +1 -0
  30. package/dist/esm/packages/taco/src/components/Header/components/Button.js +23 -0
  31. package/dist/esm/packages/taco/src/components/Header/components/Button.js.map +1 -0
  32. package/dist/esm/packages/taco/src/components/Header/components/Link.js +48 -0
  33. package/dist/esm/packages/taco/src/components/Header/components/Link.js.map +1 -0
  34. package/dist/esm/packages/taco/src/components/Header/components/Logo.js +73 -0
  35. package/dist/esm/packages/taco/src/components/Header/components/Logo.js.map +1 -0
  36. package/dist/esm/packages/taco/src/components/Header/components/MenuButton.js +16 -0
  37. package/dist/esm/packages/taco/src/components/Header/components/MenuButton.js.map +1 -0
  38. package/dist/esm/packages/taco/src/components/Header/components/PrimaryNavigation.js +134 -0
  39. package/dist/esm/packages/taco/src/components/Header/components/PrimaryNavigation.js.map +1 -0
  40. package/dist/esm/packages/taco/src/components/Header/components/SecondaryNavigation.js +13 -0
  41. package/dist/esm/packages/taco/src/components/Header/components/SecondaryNavigation.js.map +1 -0
  42. package/dist/esm/packages/taco/src/components/Layout/Layout.js +28 -0
  43. package/dist/esm/packages/taco/src/components/Layout/Layout.js.map +1 -0
  44. package/dist/esm/packages/taco/src/components/Layout/components/Content.js +13 -0
  45. package/dist/esm/packages/taco/src/components/Layout/components/Content.js.map +1 -0
  46. package/dist/esm/packages/taco/src/components/Layout/components/Context.js +9 -0
  47. package/dist/esm/packages/taco/src/components/Layout/components/Context.js.map +1 -0
  48. package/dist/esm/packages/taco/src/components/Layout/components/Page.js +13 -0
  49. package/dist/esm/packages/taco/src/components/Layout/components/Page.js.map +1 -0
  50. package/dist/esm/packages/taco/src/components/Layout/components/Sidebar.js +83 -0
  51. package/dist/esm/packages/taco/src/components/Layout/components/Sidebar.js.map +1 -0
  52. package/dist/esm/packages/taco/src/components/Layout/components/Top.js +15 -0
  53. package/dist/esm/packages/taco/src/components/Layout/components/Top.js.map +1 -0
  54. package/dist/esm/packages/taco/src/components/Navigation2/Navigation2.js +31 -0
  55. package/dist/esm/packages/taco/src/components/Navigation2/Navigation2.js.map +1 -0
  56. package/dist/esm/packages/taco/src/components/Navigation2/components/Content.js +19 -0
  57. package/dist/esm/packages/taco/src/components/Navigation2/components/Content.js.map +1 -0
  58. package/dist/esm/packages/taco/src/components/Navigation2/components/Group.js +46 -0
  59. package/dist/esm/packages/taco/src/components/Navigation2/components/Group.js.map +1 -0
  60. package/dist/esm/packages/taco/src/components/Navigation2/components/Link.js +71 -0
  61. package/dist/esm/packages/taco/src/components/Navigation2/components/Link.js.map +1 -0
  62. package/dist/esm/packages/taco/src/components/Navigation2/components/Section.js +24 -0
  63. package/dist/esm/packages/taco/src/components/Navigation2/components/Section.js.map +1 -0
  64. package/dist/esm/packages/taco/src/components/Provider/Localization.js +18 -11
  65. package/dist/esm/packages/taco/src/components/Provider/Localization.js.map +1 -1
  66. package/dist/esm/packages/taco/src/components/SearchInput/SearchInput.js +4 -1
  67. package/dist/esm/packages/taco/src/components/SearchInput/SearchInput.js.map +1 -1
  68. package/dist/esm/packages/taco/src/hooks/useBoundaryOverflowDetection.js +3 -1
  69. package/dist/esm/packages/taco/src/hooks/useBoundaryOverflowDetection.js.map +1 -1
  70. package/dist/esm/packages/taco/src/hooks/useIsLargeScreen.js +6 -0
  71. package/dist/esm/packages/taco/src/hooks/useIsLargeScreen.js.map +1 -0
  72. package/dist/esm/packages/taco/src/hooks/useMatchMedia.js +18 -0
  73. package/dist/esm/packages/taco/src/hooks/useMatchMedia.js.map +1 -0
  74. package/dist/esm/packages/taco/src/index.js +9 -0
  75. package/dist/esm/packages/taco/src/index.js.map +1 -1
  76. package/dist/esm/packages/taco/src/primitives/Collection/Collection.js +3 -0
  77. package/dist/esm/packages/taco/src/primitives/Collection/Collection.js.map +1 -0
  78. package/dist/esm/packages/taco/src/primitives/Collection/components/Root.js +4 -1
  79. package/dist/esm/packages/taco/src/primitives/Collection/components/Root.js.map +1 -1
  80. package/dist/esm/packages/taco/src/primitives/Listbox2/components/Root.js +1 -0
  81. package/dist/esm/packages/taco/src/primitives/Listbox2/components/Root.js.map +1 -1
  82. package/dist/hooks/useIsLargeScreen.d.ts +1 -0
  83. package/dist/hooks/useMatchMedia.d.ts +1 -0
  84. package/dist/index.d.ts +7 -0
  85. package/dist/taco.cjs.development.js +809 -17
  86. package/dist/taco.cjs.development.js.map +1 -1
  87. package/dist/taco.cjs.production.min.js +1 -1
  88. package/dist/taco.cjs.production.min.js.map +1 -1
  89. package/package.json +2 -2
  90. package/types.json +538 -101
  91. package/dist/components/Accordion/Accordion.stories.d.ts +0 -26
  92. package/dist/components/Alert/Alert.stories.d.ts +0 -36
  93. package/dist/components/AlertDialog/AlertDialog.stories.d.ts +0 -10
  94. package/dist/components/Backdrop/Backdrop.stories.d.ts +0 -7
  95. package/dist/components/BadgeIcon/BadgeIcon.stories.d.ts +0 -12
  96. package/dist/components/Banner/Banner.stories.d.ts +0 -5
  97. package/dist/components/Button/Button.stories.d.ts +0 -77
  98. package/dist/components/Calendar/Calendar.stories.d.ts +0 -13
  99. package/dist/components/Card/Card.stories.d.ts +0 -12
  100. package/dist/components/Datepicker/Datepicker.stories.d.ts +0 -43
  101. package/dist/components/Dialog/Dialog.stories.d.ts +0 -57
  102. package/dist/components/Field/Field.stories.d.ts +0 -14
  103. package/dist/components/Form/Form.stories.d.ts +0 -14
  104. package/dist/components/Group/Group.stories.d.ts +0 -23
  105. package/dist/components/Hanger/Hanger.stories.d.ts +0 -11
  106. package/dist/components/HoverCard/HoverCard.stories.d.ts +0 -16
  107. package/dist/components/Icon/Icon.stories.d.ts +0 -8
  108. package/dist/components/IconButton/IconButton.stories.d.ts +0 -12
  109. package/dist/components/Input/Input.stories.d.ts +0 -17
  110. package/dist/components/Listbox/Listbox.stories.d.ts +0 -44
  111. package/dist/components/Menu/Menu.stories.d.ts +0 -73
  112. package/dist/components/Navigation/Navigation.stories.d.ts +0 -7
  113. package/dist/components/Pagination/Pagination.stories.d.ts +0 -28
  114. package/dist/components/Popover/Popover.stories.d.ts +0 -29
  115. package/dist/components/Progress/Progress.stories.d.ts +0 -9
  116. package/dist/components/RadioGroup/RadioGroup.stories.d.ts +0 -49
  117. package/dist/components/ScrollArea/ScrollArea.stories.d.ts +0 -8
  118. package/dist/components/SearchInput/SearchInput.stories.d.ts +0 -38
  119. package/dist/components/Select/Select.stories.d.ts +0 -35
  120. package/dist/components/Select2/Select2.stories.d.ts +0 -57
  121. package/dist/components/Spinner/Spinner.stories.d.ts +0 -15
  122. package/dist/components/Table/Table.stories.d.ts +0 -32
  123. package/dist/components/Table2/Table2.stories.d.ts +0 -48
  124. package/dist/components/Tabs/Tabs.stories.d.ts +0 -19
  125. package/dist/components/Tag/Tag.stories.d.ts +0 -9
  126. package/dist/components/Textarea/Textarea.stories.d.ts +0 -40
  127. package/dist/components/Toast/Toast.stories.d.ts +0 -12
  128. package/dist/components/Tooltip/Tooltip.stories.d.ts +0 -26
  129. package/dist/components/Tour/Tour.stories.d.ts +0 -11
  130. package/dist/css/Typography.stories.d.ts +0 -6
  131. package/dist/hooks/useIsRefOverflowing.d.ts +0 -2
  132. package/dist/primitives/Collection/Collection.stories.d.ts +0 -8
  133. package/dist/primitives/Listbox2/Listbox2.stories.d.ts +0 -16
  134. package/dist/primitives/Sortable/Sortable.stories.d.ts +0 -14
@@ -0,0 +1,13 @@
1
+ import React__default from 'react';
2
+ import cn from 'classnames';
3
+
4
+ const Page = /*#__PURE__*/React__default.forwardRef(function LayoutPage(props, ref) {
5
+ const className = cn('flex flex-grow overflow-hidden relative', props.className);
6
+ return /*#__PURE__*/React__default.createElement("div", Object.assign({}, props, {
7
+ className: className,
8
+ ref: ref
9
+ }));
10
+ });
11
+
12
+ export { Page };
13
+ //# sourceMappingURL=Page.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Page.js","sources":["../../../../../../../../src/components/Layout/components/Page.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\n\nexport type LayoutPageProps = React.HTMLAttributes<HTMLDivElement>;\n\nexport const Page = React.forwardRef<HTMLDivElement, LayoutPageProps>(function LayoutPage(props, ref) {\n const className = cn('flex flex-grow overflow-hidden relative', props.className);\n return <div {...props} className={className} ref={ref} />;\n});\n"],"names":["Page","React","forwardRef","LayoutPage","props","ref","className","cn"],"mappings":";;;MAKaA,IAAI,gBAAGC,cAAK,CAACC,UAAU,CAAkC,SAASC,UAAU,CAACC,KAAK,EAAEC,GAAG;EAChG,MAAMC,SAAS,GAAGC,EAAE,CAAC,yCAAyC,EAAEH,KAAK,CAACE,SAAS,CAAC;EAChF,oBAAOL,sDAASG,KAAK;IAAEE,SAAS,EAAEA,SAAS;IAAED,GAAG,EAAEA;KAAO;AAC7D,CAAC;;;;"}
@@ -0,0 +1,83 @@
1
+ import React__default from 'react';
2
+ import cn from 'classnames';
3
+ import { Backdrop } from '../../Backdrop/Backdrop.js';
4
+ import { useMergedRef } from '../../../hooks/useMergedRef.js';
5
+ import { LayoutContext } from './Context.js';
6
+ import { useIsLargeScreen } from '../../../hooks/useIsLargeScreen.js';
7
+
8
+ const SidebarBackdrop = /*#__PURE__*/React__default.forwardRef(function SidebarBackdrop(props, ref) {
9
+ const internalRef = useMergedRef(ref);
10
+ React__default.useEffect(() => {
11
+ if (internalRef.current) {
12
+ internalRef.current.style.opacity = '1'; // Trigger the animation
13
+ }
14
+
15
+ return () => {
16
+ if (internalRef.current) {
17
+ internalRef.current.style.opacity = '0'; // Reset to the initial value
18
+ }
19
+ };
20
+ }, []);
21
+ return /*#__PURE__*/React__default.createElement(Backdrop, Object.assign({}, props, {
22
+ className: "absolute z-[1] opacity-0 transition-opacity duration-300",
23
+ ref: internalRef
24
+ }));
25
+ });
26
+ const Sidebar = /*#__PURE__*/React__default.forwardRef(function LayoutSidebar(props, ref) {
27
+ const {
28
+ children,
29
+ ...attributes
30
+ } = props;
31
+ const {
32
+ sidebarOpen,
33
+ setSidebarOpen
34
+ } = React__default.useContext(LayoutContext);
35
+ const isLargeScreen = useIsLargeScreen();
36
+ const isSmallScreen = !isLargeScreen;
37
+ // if it's a large screen we override the open state and make it always visible
38
+ const isVisible = isLargeScreen || sidebarOpen;
39
+ // ensures the menu is always closed by default when resizing to a smaller window size
40
+ React__default.useEffect(() => {
41
+ setSidebarOpen(isLargeScreen);
42
+ }, [isLargeScreen]);
43
+ React__default.useEffect(() => {
44
+ const handleEscapeKey = event => {
45
+ if (event.key === 'Escape') {
46
+ event.preventDefault();
47
+ event.stopPropagation();
48
+ setSidebarOpen(false);
49
+ }
50
+ };
51
+ if (isSmallScreen && sidebarOpen) {
52
+ window.addEventListener('keydown', handleEscapeKey);
53
+ }
54
+ return () => {
55
+ window.removeEventListener('keydown', handleEscapeKey);
56
+ };
57
+ }, [isSmallScreen, sidebarOpen]);
58
+ const showBackdrop = isSmallScreen && sidebarOpen === true;
59
+ const className = cn('bg-grey-50 h-full w-64 flex-shrink-0 flex-grow-0', {
60
+ 'transition-[transform] duration-300 absolute z-10 aria-hidden:-translate-x-64': isSmallScreen,
61
+ 'border-r-2 border-black/[.08] ': !showBackdrop
62
+ }, props.className);
63
+ const toggleSidebar = () => setSidebarOpen(open => !open);
64
+ const content = typeof children === 'function' ? children({
65
+ isLargeScreen,
66
+ open: sidebarOpen,
67
+ toggleSidebar
68
+ }) : children;
69
+ if (!content) {
70
+ return null;
71
+ }
72
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("nav", Object.assign({}, attributes, {
73
+ "data-responsive": isSmallScreen,
74
+ "aria-hidden": !isVisible,
75
+ className: className,
76
+ ref: ref
77
+ }), content), showBackdrop ? /*#__PURE__*/React__default.createElement(SidebarBackdrop, {
78
+ onClick: () => setSidebarOpen(false)
79
+ }) : null);
80
+ });
81
+
82
+ export { Sidebar };
83
+ //# sourceMappingURL=Sidebar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Sidebar.js","sources":["../../../../../../../../src/components/Layout/components/Sidebar.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\nimport { LayoutContext } from './Context';\nimport { useIsLargeScreen } from '../../../hooks/useIsLargeScreen';\nimport { Backdrop } from '../../Backdrop/Backdrop';\nimport { useMergedRef } from '../../../hooks/useMergedRef';\n\nconst SidebarBackdrop = React.forwardRef<HTMLDivElement, any>(function SidebarBackdrop(props, ref) {\n const internalRef = useMergedRef<HTMLDivElement>(ref);\n\n React.useEffect(() => {\n if (internalRef.current) {\n internalRef.current.style.opacity = '1'; // Trigger the animation\n }\n return () => {\n if (internalRef.current) {\n internalRef.current.style.opacity = '0'; // Reset to the initial value\n }\n };\n }, []);\n\n return <Backdrop {...props} className=\"absolute z-[1] opacity-0 transition-opacity duration-300\" ref={internalRef} />;\n});\n\nexport type LayoutSidebarProps = React.HTMLAttributes<HTMLDivElement>;\n\nexport const Sidebar = React.forwardRef<HTMLDivElement, LayoutSidebarProps>(function LayoutSidebar(props, ref) {\n const { children, ...attributes } = props;\n const { sidebarOpen, setSidebarOpen } = React.useContext(LayoutContext);\n const isLargeScreen = useIsLargeScreen();\n const isSmallScreen = !isLargeScreen;\n\n // if it's a large screen we override the open state and make it always visible\n const isVisible = isLargeScreen || sidebarOpen;\n\n // ensures the menu is always closed by default when resizing to a smaller window size\n React.useEffect(() => {\n setSidebarOpen(isLargeScreen);\n }, [isLargeScreen]);\n\n React.useEffect(() => {\n const handleEscapeKey = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n event.preventDefault();\n event.stopPropagation();\n setSidebarOpen(false);\n }\n };\n\n if (isSmallScreen && sidebarOpen) {\n window.addEventListener('keydown', handleEscapeKey);\n }\n\n return () => {\n window.removeEventListener('keydown', handleEscapeKey);\n };\n }, [isSmallScreen, sidebarOpen]);\n\n const showBackdrop = isSmallScreen && sidebarOpen === true;\n\n const className = cn(\n 'bg-grey-50 h-full w-64 flex-shrink-0 flex-grow-0',\n {\n 'transition-[transform] duration-300 absolute z-10 aria-hidden:-translate-x-64': isSmallScreen,\n 'border-r-2 border-black/[.08] ': !showBackdrop,\n },\n props.className\n );\n\n const toggleSidebar = () => setSidebarOpen(open => !open);\n const content = typeof children === 'function' ? children({ isLargeScreen, open: sidebarOpen, toggleSidebar }) : children;\n\n if (!content) {\n return null;\n }\n\n return (\n <>\n <nav {...attributes} data-responsive={isSmallScreen} aria-hidden={!isVisible} className={className} ref={ref}>\n {content}\n </nav>\n {showBackdrop ? <SidebarBackdrop onClick={() => setSidebarOpen(false)} /> : null}\n </>\n );\n});\n"],"names":["SidebarBackdrop","React","forwardRef","props","ref","internalRef","useMergedRef","useEffect","current","style","opacity","Backdrop","className","Sidebar","LayoutSidebar","children","attributes","sidebarOpen","setSidebarOpen","useContext","LayoutContext","isLargeScreen","useIsLargeScreen","isSmallScreen","isVisible","handleEscapeKey","event","key","preventDefault","stopPropagation","window","addEventListener","removeEventListener","showBackdrop","cn","toggleSidebar","open","content","onClick"],"mappings":";;;;;;;AAOA,MAAMA,eAAe,gBAAGC,cAAK,CAACC,UAAU,CAAsB,SAASF,eAAe,CAACG,KAAK,EAAEC,GAAG;EAC7F,MAAMC,WAAW,GAAGC,YAAY,CAAiBF,GAAG,CAAC;EAErDH,cAAK,CAACM,SAAS,CAAC;IACZ,IAAIF,WAAW,CAACG,OAAO,EAAE;MACrBH,WAAW,CAACG,OAAO,CAACC,KAAK,CAACC,OAAO,GAAG,GAAG,CAAC;;;IAE5C,OAAO;MACH,IAAIL,WAAW,CAACG,OAAO,EAAE;QACrBH,WAAW,CAACG,OAAO,CAACC,KAAK,CAACC,OAAO,GAAG,GAAG,CAAC;;KAE/C;GACJ,EAAE,EAAE,CAAC;EAEN,oBAAOT,6BAACU,QAAQ,oBAAKR,KAAK;IAAES,SAAS,EAAC,0DAA0D;IAACR,GAAG,EAAEC;KAAe;AACzH,CAAC,CAAC;MAIWQ,OAAO,gBAAGZ,cAAK,CAACC,UAAU,CAAqC,SAASY,aAAa,CAACX,KAAK,EAAEC,GAAG;EACzG,MAAM;IAAEW,QAAQ;IAAE,GAAGC;GAAY,GAAGb,KAAK;EACzC,MAAM;IAAEc,WAAW;IAAEC;GAAgB,GAAGjB,cAAK,CAACkB,UA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mBAAe,CAACC,SAAS;IAAEZ,SAAS,EAAEA,SAAS;IAAER,GAAG,EAAEA;MACpGiC,OAAO,CACN,EACLJ,YAAY,gBAAGhC,6BAACD,eAAe;IAACsC,OAAO,EAAE,MAAMpB,cAAc,CAAC,KAAK;IAAK,GAAG,IAAI,CACjF;AAEX,CAAC;;;;"}
@@ -0,0 +1,15 @@
1
+ import React__default from 'react';
2
+ import { LayoutContext } from './Context.js';
3
+
4
+ const Top = props => {
5
+ const {
6
+ setSidebarOpen
7
+ } = React__default.useContext(LayoutContext);
8
+ const toggleSidebar = () => setSidebarOpen(open => !open);
9
+ return typeof props.children === 'function' ? props.children({
10
+ toggleSidebar
11
+ }) : props.children;
12
+ };
13
+
14
+ export { Top };
15
+ //# sourceMappingURL=Top.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Top.js","sources":["../../../../../../../../src/components/Layout/components/Top.tsx"],"sourcesContent":["import React from 'react';\nimport { LayoutContext } from './Context';\n\nexport type LayoutTopProps = {\n children: React.ReactNode | React.ReactNode[] | (({ toggleSidebar }) => React.ReactNode | React.ReactNode[]);\n};\n\nexport const Top = (props: LayoutTopProps) => {\n const { setSidebarOpen } = React.useContext(LayoutContext);\n const toggleSidebar = () => setSidebarOpen(open => !open);\n\n return typeof props.children === 'function' ? props.children({ toggleSidebar }) : props.children;\n};\n"],"names":["Top","props","setSidebarOpen","React","useContext","LayoutContext","toggleSidebar","open","children"],"mappings":";;;MAOaA,GAAG,GAAIC,KAAqB;EACrC,MAAM;IAAEC;GAAgB,GAAGC,cAAK,CAACC,UAAU,CAACC,aAAa,CAAC;EAC1D,MAAMC,aAAa,GAAG,MAAMJ,cAAc,CAACK,IAAI,IAAI,CAACA,IAAI,CAAC;EAEzD,OAAO,OAAON,KAAK,CAACO,QAAQ,KAAK,UAAU,GAAGP,KAAK,CAACO,QAAQ,CAAC;IAAEF;GAAe,CAAC,GAAGL,KAAK,CAACO,QAAQ;AACpG;;;;"}
@@ -0,0 +1,31 @@
1
+ import React__default from 'react';
2
+ import cn from 'classnames';
3
+ import { Group } from './components/Group.js';
4
+ import { Link } from './components/Link.js';
5
+ export { getNavigationLinkClasses } from './components/Link.js';
6
+ import { Section } from './components/Section.js';
7
+ import { Content } from './components/Content.js';
8
+
9
+ const Navigation2 = /*#__PURE__*/React__default.forwardRef(function Navigation2(props, ref) {
10
+ const {
11
+ children,
12
+ ...attributes
13
+ } = props;
14
+ const className = cn('mb-0 flex h-full flex-col gap-y-px overflow-auto pt-2 pb-0 w-full bg-grey-50', props.className);
15
+ return /*#__PURE__*/React__default.createElement("ul", Object.assign({}, attributes, {
16
+ className: className,
17
+ "data-taco": "navigation2",
18
+ ref: ref,
19
+ role: "menubar",
20
+ style: {
21
+ opacity: 0.999
22
+ }
23
+ }), children);
24
+ });
25
+ Navigation2.Group = Group;
26
+ Navigation2.Link = Link;
27
+ Navigation2.Section = Section;
28
+ Navigation2.Content = Content;
29
+
30
+ export { Navigation2 };
31
+ //# sourceMappingURL=Navigation2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Navigation2.js","sources":["../../../../../../../src/components/Navigation2/Navigation2.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\nimport { Group } from './components/Group';\nimport { Link } from './components/Link';\nimport { Section } from './components/Section';\nimport { Content } from './components/Content';\n\nexport type Navigation2Props = React.HTMLAttributes<HTMLUListElement>;\n\nexport const Navigation2 = React.forwardRef<HTMLUListElement, Navigation2Props>(function Navigation2(props, ref) {\n const { children, ...attributes } = props;\n const className = cn('mb-0 flex h-full flex-col gap-y-px overflow-auto pt-2 pb-0 w-full bg-grey-50', props.className);\n\n return (\n <ul {...attributes} className={className} data-taco=\"navigation2\" ref={ref} role=\"menubar\" style={{ opacity: 0.999 }}>\n {children}\n </ul>\n );\n}) as React.ForwardRefExoticComponent<Navigation2Props> & {\n Group: typeof Group;\n Link: typeof Link;\n Section: typeof Section;\n Content: typeof Content;\n};\n\nNavigation2.Group = Group;\nNavigation2.Link = Link;\nNavigation2.Section = Section;\nNavigation2.Content = Content;\n\nexport { getNavigationLinkClasses } from './components/Link';\n\nexport type { Navigation2ContentProps } from './components/Content';\nexport type { Navigation2GroupProps } from './components/Group';\nexport type { Navigation2LinkProps } from './components/Link';\nexport type { Navigation2SectionProps } from './components/Section';\n"],"names":["Navigation2","React","forwardRef","props","ref","children","attributes","className","cn","role","style","opacity","Group","Link","Section","Content"],"mappings":";;;;;;;;MASaA,WAAW,gBAAGC,cAAK,CAACC,UAAU,CAAqC,SAASF,WAAW,CAACG,KAAK,EAAEC,GAAG;EAC3G,MAAM;IAAEC,QAAQ;IAAE,GAAGC;GAAY,GAAGH,KAAK;EACzC,MAAMI,SAAS,GAAGC,EAAE,CAAC,8EAA8E,EAAEL,KAAK,CAACI,SAAS,CAAC;EAErH,oBACIN,qDAAQK,UAAU;IAAEC,SAAS,EAAEA,SAAS;iBAAY,aAAa;IAACH,GAAG,EAAEA,GAAG;IAAEK,IAAI,EAAC,SAAS;IAACC,KAAK,EAAE;MAAEC,OAAO,EAAE;;MACxGN,QAAQ,CACR;AAEb,CAAC;AAODL,WAAW,CAACY,KAAK,GAAGA,KAAK;AACzBZ,WAAW,CAACa,IAAI,GAAGA,IAAI;AACvBb,WAAW,CAACc,OAAO,GAAGA,OAAO;AAC7Bd,WAAW,CAACe,OAAO,GAAGA,OAAO;;;;"}
@@ -0,0 +1,19 @@
1
+ import React__default from 'react';
2
+ import cn from 'classnames';
3
+
4
+ const Content = /*#__PURE__*/React__default.forwardRef(function Navigation2(props, ref) {
5
+ const {
6
+ children,
7
+ ...attributes
8
+ } = props;
9
+ const className = cn('w-full overflow-auto p-3 mt-auto border-grey-200 flex-shrink-0 z-10 bg-grey-50', '[[data-taco="navigation2-link"]+&]:border-t-2 [[data-taco="navigation2-section"]+&]:border-t-2', props.className);
10
+ return /*#__PURE__*/React__default.createElement("li", Object.assign({}, attributes, {
11
+ className: className,
12
+ "data-taco": "navigation2-content",
13
+ ref: ref,
14
+ role: "none"
15
+ }), children);
16
+ });
17
+
18
+ export { Content };
19
+ //# sourceMappingURL=Content.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Content.js","sources":["../../../../../../../../src/components/Navigation2/components/Content.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\n\nexport type Navigation2ContentProps = React.LiHTMLAttributes<HTMLLIElement>;\n\nexport const Content = React.forwardRef<HTMLLIElement, Navigation2ContentProps>(function Navigation2(props, ref) {\n const { children, ...attributes } = props;\n const className = cn(\n 'w-full overflow-auto p-3 mt-auto border-grey-200 flex-shrink-0 z-10 bg-grey-50',\n '[[data-taco=\"navigation2-link\"]+&]:border-t-2 [[data-taco=\"navigation2-section\"]+&]:border-t-2',\n props.className\n );\n\n return (\n <li {...attributes} className={className} data-taco=\"navigation2-content\" ref={ref} role=\"none\">\n {children}\n </li>\n );\n});\n"],"names":["Content","React","forwardRef","Navigation2","props","ref","children","attributes","className","cn","role"],"mappings":";;;MAKaA,OAAO,gBAAGC,cAAK,CAACC,UAAU,CAAyC,SAASC,WAAW,CAACC,KAAK,EAAEC,GAAG;EAC3G,MAAM;IAAEC,QAAQ;IAAE,GAAGC;GAAY,GAAGH,KAAK;EACzC,MAAMI,SAAS,GAAGC,EAAE,CAChB,gFAAgF,EAChF,gGAAgG,EAChGL,KAAK,CAACI,SAAS,CAClB;EAED,oBACIP,qDAAQM,UAAU;IAAEC,SAAS,EAAEA,SAAS;iBAAY,qBAAqB;IAACH,GAAG,EAAEA,GAAG;IAAEK,IAAI,EAAC;MACpFJ,QAAQ,CACR;AAEb,CAAC;;;;"}
@@ -0,0 +1,46 @@
1
+ import React__default from 'react';
2
+ import cn from 'classnames';
3
+ import { Icon } from '../../Icon/Icon.js';
4
+
5
+ const Group = /*#__PURE__*/React__default.forwardRef(function Group(props, ref) {
6
+ const {
7
+ children,
8
+ defaultExpanded = false,
9
+ heading,
10
+ onClick,
11
+ ...attributes
12
+ } = props;
13
+ const [expanded, setExpanded] = React__default.useState(defaultExpanded);
14
+ const className = cn('flex w-full cursor-pointer items-center rounded px-3 font-bold text-left leading-8 hover:bg-black/[.06] focus-visible:yt-focus-dark', attributes.className);
15
+ const handleClick = event => {
16
+ setExpanded(!expanded);
17
+ if (onClick) {
18
+ onClick(event);
19
+ }
20
+ };
21
+ return /*#__PURE__*/React__default.createElement("li", {
22
+ role: "none",
23
+ className: "[[role=menubar]>&]:px-3"
24
+ }, /*#__PURE__*/React__default.createElement("button", Object.assign({}, attributes, {
25
+ "aria-haspopup": "menu",
26
+ "aria-expanded": expanded,
27
+ "data-taco": "navigation2-group",
28
+ className: className,
29
+ onClick: handleClick,
30
+ ref: ref,
31
+ role: "menuitem"
32
+ }), /*#__PURE__*/React__default.createElement(Icon, {
33
+ className: "-ml-2 !h-5 !w-5",
34
+ name: expanded ? 'chevron-down-solid' : 'chevron-right-solid'
35
+ }), /*#__PURE__*/React__default.createElement("span", {
36
+ className: "flex-grow truncate"
37
+ }, heading)), /*#__PURE__*/React__default.createElement("ul", {
38
+ className: cn('mb-0 flex flex-col gap-y-px pt-px', {
39
+ hidden: !expanded
40
+ }),
41
+ role: "menu"
42
+ }, children));
43
+ });
44
+
45
+ export { Group };
46
+ //# sourceMappingURL=Group.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Group.js","sources":["../../../../../../../../src/components/Navigation2/components/Group.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\nimport { Icon } from '../../Icon/Icon';\n\nexport type Navigation2GroupProps = React.ButtonHTMLAttributes<HTMLButtonElement> & {\n defaultExpanded?: boolean;\n heading: string | JSX.Element;\n};\n\nexport const Group = React.forwardRef<HTMLButtonElement, Navigation2GroupProps>(function Group(props, ref) {\n const { children, defaultExpanded = false, heading, onClick, ...attributes } = props;\n const [expanded, setExpanded] = React.useState(defaultExpanded);\n const className = cn(\n 'flex w-full cursor-pointer items-center rounded px-3 font-bold text-left leading-8 hover:bg-black/[.06] focus-visible:yt-focus-dark',\n attributes.className\n );\n\n const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {\n setExpanded(!expanded);\n\n if (onClick) {\n onClick(event);\n }\n };\n\n return (\n <li role=\"none\" className=\"[[role=menubar]>&]:px-3\">\n <button\n {...attributes}\n aria-haspopup=\"menu\"\n aria-expanded={expanded}\n data-taco=\"navigation2-group\"\n className={className}\n onClick={handleClick}\n ref={ref}\n role=\"menuitem\">\n <Icon className=\"-ml-2 !h-5 !w-5\" name={expanded ? 'chevron-down-solid' : 'chevron-right-solid'} />\n <span className=\"flex-grow truncate\">{heading}</span>\n </button>\n <ul className={cn('mb-0 flex flex-col gap-y-px pt-px', { hidden: !expanded })} role=\"menu\">\n {children}\n </ul>\n </li>\n );\n});\n"],"names":["Group","React","forwardRef","props","ref","children","defaultExpanded","heading","onClick","attributes","expanded","setExpanded","useState","className","cn","handleClick","event","role","Icon","name","hidden"],"mappings":";;;;MASaA,KAAK,gBAAGC,cAAK,CAACC,UAAU,CAA2C,SAASF,KAAK,CAACG,KAAK,EAAEC,GAAG;EACrG,MAAM;IAAEC,QAAQ;IAAEC,eAAe,GAAG,KAAK;IAAEC,OAAO;IAAEC,OAAO;IAAE,GAAGC;GAAY,GAAGN,KAAK;EACpF,MAAM,CAACO,QAAQ,EAAEC,WAAW,CAAC,GAAGV,cAAK,CAACW,QAAQ,CAACN,eAAe,CAAC;EAC/D,MAAMO,SAAS,GAAGC,EAAE,CAChB,qIAAqI,EACrIL,UAAU,CAACI,SAAS,CACvB;EAED,MAAME,WAAW,GAAIC,KAA0C;IAC3DL,WAAW,CAAC,CAACD,QAAQ,CAAC;IAEtB,IAAIF,OAAO,EAAE;MACTA,OAAO,CAACQ,KAAK,CAAC;;GAErB;EAED,oBACIf;IAAIgB,IAAI,EAAC,MAAM;IAACJ,SAAS,EAAC;kBACtBZ,yDACQQ,UAAU;qBACA,MAAM;qBACLC,QAAQ;iBACb,mBAAmB;IAC7BG,SAAS,EAAEA,SAAS;IACpBL,OAAO,EAAEO,WAAW;IACpBX,GAAG,EAAEA,GAAG;IACRa,IAAI,EAAC;mBACLhB,6BAACiB,IAAI;IAACL,SAAS,EAAC,iBAAiB;IAACM,IAAI,EAAET,QAAQ,GAAG,oBAAoB,GAAG;IAAyB,eACnGT;IAAMY,SAAS,EAAC;KAAsBN,OAAO,CAAQ,CAChD,eACTN;IAAIY,SAAS,EAAEC,EAAE,CAAC,mCAAmC,EAAE;MAAEM,MAAM,EAAE,CAACV;KAAU,CAAC;IAAEO,IAAI,EAAC;KAC/EZ,QAAQ,CACR,CACJ;AAEb,CAAC;;;;"}
@@ -0,0 +1,71 @@
1
+ import React__default from 'react';
2
+ import cn from 'classnames';
3
+ import { Icon } from '../../Icon/Icon.js';
4
+ import { Badge } from '../../Badge/Badge.js';
5
+ import { IconButton } from '../../IconButton/IconButton.js';
6
+ import { useDropTarget } from '../../../utils/hooks/useDropTarget.js';
7
+
8
+ const getNavigationLinkClasses = (isDraggedOver = false) => cn('group relative flex w-full items-center rounded leading-8 !text-black px-2 focus-visible:yt-focus-dark',
9
+ // override styles for links that are children of collapsible menus
10
+ 'font-bold [[role=menu]>li>&]:font-normal [[role=menu]>li>&]:pl-5',
11
+ // override styles to adjust icons included in menu links
12
+ '[&_[data-taco="icon"]]:!h-5 [&_[data-taco="icon"]]:!w-5',
13
+ // override styles to adjust badges included in menu links
14
+ '[&>span_[data-taco="badge"]]:mr-2.5 [[role=menu]>li>&>span_[data-taco="badge"]]:mr-2', {
15
+ 'hover:bg-black/[.06] aria-current-page:bg-blue-500/[.1]': !isDraggedOver,
16
+ '!bg-blue-500 !text-white [&>*]:!text-white': isDraggedOver
17
+ });
18
+ const Link = /*#__PURE__*/React__default.forwardRef(function Link(props, ref) {
19
+ const {
20
+ active,
21
+ children,
22
+ icon,
23
+ menu,
24
+ onDrop,
25
+ total,
26
+ ...attributes
27
+ } = props;
28
+ const [isDraggedOver, dropTargetProps] = useDropTarget(onDrop);
29
+ const className = cn(getNavigationLinkClasses(isDraggedOver), attributes.className);
30
+ const listClassName = cn('[[role=menubar]>&]:px-3', {
31
+ '[&>*]:pointer-events-none': isDraggedOver
32
+ });
33
+ return /*#__PURE__*/React__default.createElement("li", Object.assign({}, dropTargetProps, {
34
+ className: listClassName,
35
+ "data-taco": "navigation2-link-item",
36
+ role: "none"
37
+ }), /*#__PURE__*/React__default.createElement("a", Object.assign({}, attributes, {
38
+ "aria-current": active ? 'page' : undefined,
39
+ className: className,
40
+ "data-taco": "navigation2-link",
41
+ ref: ref,
42
+ role: "menuitem",
43
+ tabIndex: 0
44
+ }), icon ? /*#__PURE__*/React__default.createElement(Icon, {
45
+ className: "mr-1.5 [[role=menu]>li>a>&]:mr-0.5 [[role=menu]>li>a>&]:-ml-1.5",
46
+ name: icon
47
+ }) : null, /*#__PURE__*/React__default.createElement("span", {
48
+ className: "flex flex-grow items-center truncate"
49
+ }, children), menu ? /*#__PURE__*/React__default.createElement(IconButton, {
50
+ appearance: "discrete",
51
+ icon: "more",
52
+ "aria-label": "More",
53
+ rounded: true,
54
+ className: cn('-mr-1.5 hidden flex-shrink-0 flex-grow-0 transition-none group-hover:flex aria-expanded:flex', {
55
+ 'absolute right-0 !mr-0.5': total !== undefined
56
+ }),
57
+ menu: menu,
58
+ onClick: event => {
59
+ event.preventDefault();
60
+ event.stopPropagation();
61
+ }
62
+ }) : null, total !== undefined ? /*#__PURE__*/React__default.createElement(Badge, {
63
+ className: cn('flex-shrink-0 flex-grow-0 !font-normal', {
64
+ 'group-hover:hidden [[aria-expanded="true"]+&]:hidden ': menu
65
+ }),
66
+ color: "transparent"
67
+ }, total) : null));
68
+ });
69
+
70
+ export { Link, getNavigationLinkClasses };
71
+ //# sourceMappingURL=Link.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Link.js","sources":["../../../../../../../../src/components/Navigation2/components/Link.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\nimport { Icon, IconName } from '../../Icon/Icon';\nimport { useDropTarget } from '../../../utils/hooks/useDropTarget';\nimport { IconButton } from '../../IconButton/IconButton';\nimport { Badge } from '../../Badge/Badge';\nimport { MenuProps } from '../../Menu/Menu';\n\nexport const getNavigationLinkClasses = (isDraggedOver = false) =>\n cn(\n 'group relative flex w-full items-center rounded leading-8 !text-black px-2 focus-visible:yt-focus-dark',\n // override styles for links that are children of collapsible menus\n 'font-bold [[role=menu]>li>&]:font-normal [[role=menu]>li>&]:pl-5',\n // override styles to adjust icons included in menu links\n '[&_[data-taco=\"icon\"]]:!h-5 [&_[data-taco=\"icon\"]]:!w-5',\n // override styles to adjust badges included in menu links\n '[&>span_[data-taco=\"badge\"]]:mr-2.5 [[role=menu]>li>&>span_[data-taco=\"badge\"]]:mr-2',\n {\n 'hover:bg-black/[.06] aria-current-page:bg-blue-500/[.1]': !isDraggedOver,\n '!bg-blue-500 !text-white [&>*]:!text-white': isDraggedOver,\n }\n );\n\nexport type Navigation2LinkProps = React.AnchorHTMLAttributes<HTMLAnchorElement> & {\n active?: boolean;\n icon?: IconName;\n /** Menu component associated with the button. */\n menu?: (props: Partial<MenuProps>) => JSX.Element;\n /** Handler to be used when dropping a dragged element over the Navigation2 link */\n onDrop?: React.DragEventHandler;\n /** Total shown inside a Badge component */\n total?: number;\n};\n\nexport const Link = React.forwardRef<HTMLAnchorElement, Navigation2LinkProps>(function Link(props, ref) {\n const { active, children, icon, menu, onDrop, total, ...attributes } = props;\n const [isDraggedOver, dropTargetProps] = useDropTarget(onDrop);\n\n const className = cn(getNavigationLinkClasses(isDraggedOver), attributes.className);\n\n const listClassName = cn('[[role=menubar]>&]:px-3', {\n '[&>*]:pointer-events-none': isDraggedOver,\n });\n\n return (\n <li {...dropTargetProps} className={listClassName} data-taco=\"navigation2-link-item\" role=\"none\">\n <a\n {...attributes}\n aria-current={active ? 'page' : undefined}\n className={className}\n data-taco=\"navigation2-link\"\n ref={ref}\n role=\"menuitem\"\n tabIndex={0}>\n {icon ? <Icon className=\"mr-1.5 [[role=menu]>li>a>&]:mr-0.5 [[role=menu]>li>a>&]:-ml-1.5\" name={icon} /> : null}\n <span className=\"flex flex-grow items-center truncate\">{children}</span>\n {menu ? (\n <IconButton\n appearance=\"discrete\"\n icon=\"more\"\n aria-label=\"More\"\n rounded\n className={cn(\n '-mr-1.5 hidden flex-shrink-0 flex-grow-0 transition-none group-hover:flex aria-expanded:flex',\n {\n 'absolute right-0 !mr-0.5': total !== undefined,\n }\n )}\n menu={menu}\n onClick={event => {\n event.preventDefault();\n event.stopPropagation();\n }}\n />\n ) : null}\n {total !== undefined ? (\n <Badge\n className={cn('flex-shrink-0 flex-grow-0 !font-normal', {\n 'group-hover:hidden [[aria-expanded=\"true\"]+&]:hidden ': menu,\n })}\n color=\"transparent\">\n {total}\n </Badge>\n ) : null}\n </a>\n </li>\n );\n});\n"],"names":["getNavigationLinkClasses","isDraggedOver","cn","Link","React","forwardRef","props","ref","active","children","icon","menu","onDrop","total","attributes","dropTargetProps","useDropTarget","className","listClassName","role","undefined","tabIndex","Icon","name","IconButton","appearance","rounded","onClick","event","preventDefault","stopPropagation","Badge","color"],"mappings":";;;;;;;MAQaA,wBAAwB,GAAG,CAACC,aAAa,GAAG,KAAK,KAC1DC,EAAE,CACE,wGAAwG;AACxG;AACA,kEAAkE;AAClE;AACA,yDAAyD;AACzD;AACA,sFAAsF,EACtF;EACI,yDAAyD,EAAE,CAACD,aAAa;EACzE,4CAA4C,EAAEA;CACjD;MAcIE,IAAI,gBAAGC,cAAK,CAACC,UAAU,CAA0C,SAASF,IAAI,CAACG,KAAK,EAAEC,GAAG;EAClG,MAAM;IAAEC,MAAM;IAAEC,QAAQ;IAAEC,IAAI;IAAEC,IAAI;IAAEC,MAAM;IAAEC,KAAK;IAAE,GAAGC;GAAY,GAAGR,KAAK;EAC5E,MAAM,CAACL,aAAa,EAAEc,eAAe,CAAC,GAAGC,aAAa,CAACJ,MAAM,CAAC;EAE9D,MAAMK,SAAS,GAAGf,EAAE,CAACF,wBAAwB,CAACC,aAAa,CAAC,EAAEa,UAAU,CAACG,SAAS,CAAC;EAEnF,MAAMC,aAAa,GAAGhB,EAAE,CAAC,yBAAyB,EAAE;IAChD,2BAA2B,EAAED;GAChC,CAAC;EAEF,oBACIG,qDAAQW,eAAe;IAAEE,SAAS,EAAEC,aAAa;iBAAY,uBAAuB;IAACC,IAAI,EAAC;mBACtFf,oDACQU,UAAU;oBACAN,MAAM,GAAG,MAAM,GAAGY,SAAS;IACzCH,SAAS,EAAEA,SAAS;iBACV,kBAAkB;IAC5BV,GAAG,EAAEA,GAAG;IACRY,IAAI,EAAC,UAAU;IACfE,QAAQ,EAAE;MACTX,IAAI,gBAAGN,6BAACkB,IAAI;IAACL,SAAS,EAAC,iEAAiE;IAACM,IAAI,EAAEb;IAAQ,GAAG,IAAI,eAC/GN;IAAMa,SAAS,EAAC;KAAwCR,QAAQ,CAAQ,EACvEE,IAAI,gBACDP,6BAACoB,UAAU;IACPC,UAAU,EAAC,UAAU;IACrBf,IAAI,EAAC,MAAM;kBACA,MAAM;IACjBgB,OAAO;IACPT,SAAS,EAAEf,EAAE,CACT,8FAA8F,EAC9F;MACI,0BAA0B,EAAEW,KAAK,KAAKO;KACzC,CACJ;IACDT,IAAI,EAAEA,IAAI;IACVgB,OAAO,EAAEC,KAAK;MACVA,KAAK,CAACC,cAAc,EAAE;MACtBD,KAAK,CAACE,eAAe,EAAE;;IAE7B,GACF,IAAI,EACPjB,KAAK,KAAKO,SAAS,gBAChBhB,6BAAC2B,KAAK;IACFd,SAAS,EAAEf,EAAE,CAAC,wCAAwC,EAAE;MACpD,uDAAuD,EAAES;KAC5D,CAAC;IACFqB,KAAK,EAAC;KACLnB,KAAK,CACF,GACR,IAAI,CACR,CACH;AAEb,CAAC;;;;"}
@@ -0,0 +1,24 @@
1
+ import React__default from 'react';
2
+ import cn from 'classnames';
3
+
4
+ const Section = /*#__PURE__*/React__default.forwardRef(function Navigation2(props, ref) {
5
+ const {
6
+ children,
7
+ heading,
8
+ ...attributes
9
+ } = props;
10
+ const className = cn('w-full overflow-auto px-3 py-2 -mt-3 border-grey-200 [[data-taco="navigation2-link-item"]+&]:mt-2 bg-grey-50', '[[data-taco="navigation2-link-item"]+&]:border-t-2 [[data-taco="navigation2-section"]+&]:border-t-2', '[[data-taco="navigation2-link-item"]+&]:pt-2 [[data-taco="navigation2-section"]+&]:pt-2', props.className);
11
+ return /*#__PURE__*/React__default.createElement("li", Object.assign({}, attributes, {
12
+ className: className,
13
+ "data-taco": "navigation2-section",
14
+ ref: ref,
15
+ role: "none"
16
+ }), heading ? /*#__PURE__*/React__default.createElement("span", {
17
+ className: "text-grey-500 mb-px truncate pl-5 text-xs font-bold uppercase leading-8 lg:hidden"
18
+ }, heading) : null, /*#__PURE__*/React__default.createElement("ul", {
19
+ className: "mb-0 flex flex-col gap-y-px"
20
+ }, children));
21
+ });
22
+
23
+ export { Section };
24
+ //# sourceMappingURL=Section.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Section.js","sources":["../../../../../../../../src/components/Navigation2/components/Section.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\n\nexport type Navigation2SectionProps = React.LiHTMLAttributes<HTMLLIElement> & {\n heading?: string;\n};\n\nexport const Section = React.forwardRef<HTMLLIElement, Navigation2SectionProps>(function Navigation2(props, ref) {\n const { children, heading, ...attributes } = props;\n const className = cn(\n 'w-full overflow-auto px-3 py-2 -mt-3 border-grey-200 [[data-taco=\"navigation2-link-item\"]+&]:mt-2 bg-grey-50',\n '[[data-taco=\"navigation2-link-item\"]+&]:border-t-2 [[data-taco=\"navigation2-section\"]+&]:border-t-2',\n '[[data-taco=\"navigation2-link-item\"]+&]:pt-2 [[data-taco=\"navigation2-section\"]+&]:pt-2',\n props.className\n );\n\n return (\n <li {...attributes} className={className} data-taco=\"navigation2-section\" ref={ref} role=\"none\">\n {heading ? (\n <span className=\"text-grey-500 mb-px truncate pl-5 text-xs font-bold uppercase leading-8 lg:hidden\">\n {heading}\n </span>\n ) : null}\n <ul className=\"mb-0 flex flex-col gap-y-px\">{children}</ul>\n </li>\n );\n});\n"],"names":["Section","React","forwardRef","Navigation2","props","ref","children","heading","attributes","className","cn","role"],"mappings":";;;MAOaA,OAAO,gBAAGC,cAAK,CAACC,UAAU,CAAyC,SAASC,WAAW,CAACC,KAAK,EAAEC,GAAG;EAC3G,MAAM;IAAEC,QAAQ;IAAEC,OAAO;IAAE,GAAGC;GAAY,GAAGJ,KAAK;EAClD,MAAMK,SAAS,GAAGC,EAAE,CAChB,8GAA8G,EAC9G,qGAAqG,EACrG,yFAAyF,EACzFN,KAAK,CAACK,SAAS,CAClB;EAED,oBACIR,qDAAQO,UAAU;IAAEC,SAAS,EAAEA,SAAS;iBAAY,qBAAqB;IAACJ,GAAG,EAAEA,GAAG;IAAEM,IAAI,EAAC;MACpFJ,OAAO,gBACJN;IAAMQ,SAAS,EAAC;KACXF,OAAO,CACL,GACP,IAAI,eACRN;IAAIQ,SAAS,EAAC;KAA+BH,QAAQ,CAAM,CAC1D;AAEb,CAAC;;;;"}
@@ -1,6 +1,9 @@
1
1
  import { createContext, createElement, useContext } from 'react';
2
2
 
3
3
  const defaultLocalisationTexts = {
4
+ banner: {
5
+ close: 'Close'
6
+ },
4
7
  calendar: {
5
8
  months: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
6
9
  weekdaysShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
@@ -21,21 +24,25 @@ const defaultLocalisationTexts = {
21
24
  expand: 'Show calendar',
22
25
  shortcuts: 'Shortcuts'
23
26
  },
27
+ dialog: {
28
+ close: 'Close',
29
+ drag: 'Drag'
30
+ },
24
31
  hanger: {
25
32
  close: 'Close'
26
33
  },
27
- banner: {
28
- close: 'Close'
34
+ header: {
35
+ addAgreement: 'Add agreement',
36
+ logout: 'Log off',
37
+ more: 'More',
38
+ new: 'New',
39
+ search: 'Search for agreement...'
29
40
  },
30
41
  listbox: {
31
42
  loading: 'Loading results...',
32
43
  empty: 'No results found',
33
44
  allOption: 'All'
34
45
  },
35
- dialog: {
36
- close: 'Close',
37
- drag: 'Drag'
38
- },
39
46
  pagination: {
40
47
  label: 'Pagination',
41
48
  pageSize: 'Items per page',
@@ -146,6 +153,11 @@ const defaultLocalisationTexts = {
146
153
  collapseRow: 'Collapse current row'
147
154
  }
148
155
  },
156
+ searchInput: {
157
+ button: 'Search',
158
+ placeholder: 'Search...',
159
+ clear: 'Clear'
160
+ },
149
161
  select: {
150
162
  allOptionsSelected: 'All'
151
163
  },
@@ -170,11 +182,6 @@ const defaultLocalisationTexts = {
170
182
  last: 'Done',
171
183
  next: 'Next',
172
184
  open: 'Open'
173
- },
174
- searchInput: {
175
- button: 'Search',
176
- placeholder: 'Search...',
177
- clear: 'Clear'
178
185
  }
179
186
  };
180
187
  const defaultLocalizationContext = {
@@ -1 +1 @@
1
- {"version":3,"file":"Localization.js","sources":["../../../../../../../src/components/Provider/Localization.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Locale } from '../../types';\nimport { CalendarTexts } from '../Calendar/Calendar';\nimport { ComboboxTexts } from '../Combobox/Combobox';\nimport { DialogTexts } from '../Dialog/Dialog';\nimport { PaginationTexts } from '../Pagination/Pagination';\nimport { ListboxTexts } from '../Listbox/Listbox';\nimport { ToastsTexts } from '../Toast/Toast';\nimport { DatepickerTexts } from '../Datepicker/Datepicker';\nimport { HangerTexts } from '../Hanger/Hanger';\nimport { SelectTexts } from '../Select/Select';\nimport { TourTexts } from '../Tour/Tour';\nimport { TableTexts } from '../Table/Table';\nimport { Table2Texts } from '../Table2/Table2';\nimport { SearchInputTexts } from '../SearchInput/SearchInput';\nimport { Select2Texts } from '../Select2/Select2';\nimport { BannerTexts } from '../Banner/Banner';\n\nexport type LocalizationTexts = {\n /** Localized texts and aria-labels for [Calendar](component:calendar) component */\n calendar: CalendarTexts;\n /** Localized texts and aria-labels for [Combobox](component:combobox) component */\n combobox: ComboboxTexts;\n /** Localized texts and aria-labels for [DatePicker](component:datepicker) component */\n datepicker: DatepickerTexts;\n /** Localized texts and aria-labels for [Hanger](component:hanger) component */\n hanger: HangerTexts;\n /** Localized texts and aria-labels for [Banner](component:banner) component */\n banner: BannerTexts;\n /** Localized texts and aria-labels for [Listbox](component:listbox) component */\n listbox: ListboxTexts;\n /** Localized texts and aria-labels for [Dialog](component:dialog) component */\n dialog: DialogTexts;\n /** Localized texts and aria-labels for [Pagination](component:pagination) component */\n pagination: PaginationTexts;\n /** Localized texts and aria-labels for [Table](component:table) component */\n table: TableTexts;\n /** Localized texts and aria-labels for [Table2](component:table2) component */\n table2: Table2Texts;\n /** Localized texts and aria-labels for [Select](component:select) component */\n select: SelectTexts;\n /** Localized texts and aria-labels for [Select2](component:select2) component */\n select2: Select2Texts;\n /** Localized texts and aria-labels for [Toast](component:toast) component */\n toasts: ToastsTexts;\n /** Localized texts and aria-labels for [Tour](component:tour) component */\n tour: TourTexts;\n /** Localized texts and aria-labels for [SearchInput](component:searchinput) component */\n searchInput: SearchInputTexts;\n};\n\nexport type Localization = {\n /**\n * Provide the language code used in application.\n * Default value is `en-GB`\n */\n locale: Locale;\n /** Provide the texts and aria-labels for components used within the provider */\n texts: LocalizationTexts;\n /** Provide the formatting */\n formatting: {\n /** Default value is `dd.mm.yy` */\n date: string;\n };\n};\n\nexport const defaultLocalisationTexts = {\n calendar: {\n months: [\n 'January',\n 'February',\n 'March',\n 'April',\n 'May',\n 'June',\n 'July',\n 'August',\n 'September',\n 'October',\n 'November',\n 'December',\n ],\n weekdaysShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],\n actions: {\n previousMonth: 'Previous month',\n nextMonth: 'Next month',\n previousYear: 'Previous year',\n nextYear: 'Next year',\n today: 'Today',\n },\n },\n combobox: {\n tooltip: 'Search in list',\n },\n datepicker: {\n calendar: 'Calendar',\n clear: 'Clear',\n expand: 'Show calendar',\n shortcuts: 'Shortcuts',\n },\n hanger: {\n close: 'Close',\n },\n banner: {\n close: 'Close',\n },\n listbox: {\n loading: 'Loading results...',\n empty: 'No results found',\n allOption: 'All',\n },\n dialog: {\n close: 'Close',\n drag: 'Drag',\n },\n pagination: {\n label: 'Pagination',\n pageSize: 'Items per page',\n showingXofYofTotal: 'Showing [X] - [Y] of [total]',\n actions: {\n firstPage: 'Goto first page',\n firstPageWithShortcut: 'Goto first page (Home)',\n previousPage: 'Goto previous page',\n previousPageWithShortcut: 'Goto previous page (Page Up)',\n nextPage: 'Goto next page',\n nextPageWithShortcut: 'Goto next page (Page Down)',\n lastPage: 'Goto last page',\n lastPageWithShortcut: 'Goto last page (End)',\n pageX: 'Goto page [X]',\n },\n },\n table: {\n actions: 'Other actions',\n edit: 'Edit (e)',\n copy: 'Copy (c)',\n del: 'Delete (del)',\n newSubRow: 'New row (shift + n)',\n loading: 'Loading...',\n },\n table2: {\n columns: {\n actions: {\n tooltip: 'Other actions',\n },\n drag: {\n tooltip: 'Drag row',\n },\n expansion: {\n collapse: 'Collapse row',\n collapseAll: 'Collapse all rows',\n expand: 'Expand row',\n expandAll: 'Expand all rows',\n },\n select: {\n deselect: 'Deselect row',\n deselectAll: 'Deselect all rows',\n select: 'Select row',\n selectAll: 'Select all rows',\n },\n },\n columnSettings: {\n columnsOther: 'Other columns',\n columnsOtherDrop: 'Drop column here to unpin',\n columnsPinned: 'Pinned columns',\n columnsPinnedDrop: 'Drop column here to pin',\n search: 'Search column...',\n tooltip: 'Column settings',\n },\n editing: {\n button: 'Edit',\n tooltip: 'Edit',\n tooltipDisabled: 'There are no visible columns that support editing',\n rowIndicator: {\n rowWillMove: 'Row will move due to sorting',\n rowWillBeHidden: 'Row will hide due to filtering',\n rowWillMoveReasonSearch:\n 'Due to a search filter applied to this table, this row will be hidden as soon as you select another row',\n rowWillMoveReasonFilter:\n \"Due to a filter applied to the column '[COLUMN]', this row will be hidden as soon as you select another row\",\n rowWillMoveReasonSorting:\n \"Due to sorting applied to the column '[COLUMN]', this row will move position as soon as you select another row\",\n },\n },\n filters: {\n button: 'Filters',\n buttons: {\n addFilter: 'Add Filter',\n clearFilters: 'Clear all filters',\n },\n comparators: {\n contains: 'Contains',\n doesNotContain: 'Does not contain',\n isEqualTo: 'Is',\n isNotEqualTo: 'Is not',\n isGreaterThan: 'Is greater than',\n isLessThan: 'Is less than',\n isBetween: 'Is between',\n isOneOf: 'Is one of',\n isNoneOf: 'Is none of',\n isAllOf: 'Is all of',\n isEmpty: 'Is empty',\n isNotEmpty: 'Is not empty',\n },\n tooltip: 'Apply filters',\n total: 'Viewing [CURRENT] of [TOTAL]',\n },\n rowDensity: {\n tooltip: 'Row density',\n },\n search: {\n placeholder: 'Search...',\n },\n shortcuts: {\n tooltip: 'View keyboard shortcuts',\n search: 'Search',\n filter: 'Filter',\n previousRow: 'Previous row',\n nextRow: 'Next row',\n editCell: 'Edit cell',\n previousColumn: 'Previous column',\n nextColumn: 'Next column',\n rowClick: 'Activate current row',\n selectRow: 'Select current row',\n selectAllRows: 'Select all rows',\n expandRow: 'Expand current row',\n collapseRow: 'Collapse current row',\n },\n },\n select: {\n allOptionsSelected: 'All',\n },\n select2: {\n allSelect: 'Select all',\n allDeselect: 'Deselect all',\n cancel: 'Cancel',\n chooseColor: 'Pick a color',\n create: 'Create',\n delete: 'Delete',\n save: 'Save',\n search: 'Search...',\n searchOrCreate: 'Search or create...',\n },\n toasts: {\n dismiss: 'Dismiss',\n },\n tour: {\n back: 'Back',\n close: 'Close',\n skip: 'Close and complete',\n last: 'Done',\n next: 'Next',\n open: 'Open',\n },\n searchInput: {\n button: 'Search',\n placeholder: 'Search...',\n clear: 'Clear',\n },\n};\n\nconst defaultLocalizationContext: Localization = {\n locale: 'en-GB',\n texts: defaultLocalisationTexts,\n formatting: {\n date: 'dd.mm.yy',\n },\n};\n\nexport const LocalizationContext = React.createContext<Localization>(defaultLocalizationContext);\nexport interface LocalizationProviderProps {\n children: React.ReactNode;\n localization?: Localization;\n}\nexport const LocalizationProvider: React.FC<LocalizationProviderProps> = ({ localization, children }) => {\n return (\n <LocalizationContext.Provider value={localization ?? defaultLocalizationContext}>{children}</LocalizationContext.Provider>\n );\n};\n\nexport const useLocalization = () => React.useContext(LocalizationContext);\n"],"names":["defaultLocalisationTexts","calendar","months","weekdaysShort","actions","previousMonth","nextMonth","previousYear","nextYear","today","combobox","tooltip","datepicker","clear","expand","shortcuts","hanger","close","banner","listbox","loading","empty","allOption","dialog","drag","pagination","label","pageSize","showingXofYofTotal","firstPage","firstPageWithShortcut","previousPage","previousPageWithShortcut","nextPage","nextPageWithShortcut","lastPage","lastPageWithShortcut","pageX","table","edit","copy","del","newSubRow","table2","columns","expansion","collapse","collapseAll","expandAll","select","deselect","deselectAll","selectAll","columnSettings","columnsOther","columnsOtherDrop","columnsPinned","columnsPinnedDrop","search","editing","button","tooltipDisabled","rowIndicator","rowWillMove","rowWillBeHidden","rowWillMoveReasonSearch","rowWillMoveReasonFilter","rowWillMoveReasonSorting","filters","buttons","addFilter","clearFilters","comparators","contains","doesNotContain","isEqualTo","isNotEqualTo","isGreaterThan","isLessThan","isBetween","isOneOf","isNoneOf","isAllOf","isEmpty","isNotEmpty","total","rowDensity","placeholder","filter","previousRow","nextRow","editCell","previousColumn","nextColumn","rowClick","selectRow","selectAllRows","expandRow","collapseRow","allOptionsSelected","select2","allSelect","allDeselect","cancel","chooseColor","create","delete","save","searchOrCreate","toasts","dismiss","tour","back","skip","last","next","open","searchInput","defaultLocalizationContext","locale","texts","formatting","date","LocalizationContext","React","LocalizationProvider","localization","children","Provider","value","useLocalization"],"mappings":";;MAkEaA,wBAAwB,GAAG;EACpCC,QAAQ,EAAE;IACNC,MAAM,EAAE,CACJ,SAAS,EACT,UAAU,EACV,OAAO,EACP,OAAO,EACP,KAAK,EACL,MAAM,EACN,MAAM,EACN,QAAQ,EACR,WAAW,EACX,SAAS,EACT,UAAU,EACV,UAAU,CACb;IACDC,aAAa,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,C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GAAwC,CAAC;EAAEC,YAAY;EAAEC;CAAU;EAChG,oBACIH,cAACD,mBAAmB,CAACK,QAAQ;IAACC,KAAK,EAAEH,YAAY,aAAZA,YAAY,cAAZA,YAAY,GAAIR;KAA6BS,QAAQ,CAAgC;AAElI;MAEaG,eAAe,GAAG,MAAMN,UAAgB,CAACD,mBAAmB;;;;"}
1
+ {"version":3,"file":"Localization.js","sources":["../../../../../../../src/components/Provider/Localization.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Locale } from '../../types';\nimport { CalendarTexts } from '../Calendar/Calendar';\nimport { ComboboxTexts } from '../Combobox/Combobox';\nimport { DialogTexts } from '../Dialog/Dialog';\nimport { PaginationTexts } from '../Pagination/Pagination';\nimport { ListboxTexts } from '../Listbox/Listbox';\nimport { ToastsTexts } from '../Toast/Toast';\nimport { DatepickerTexts } from '../Datepicker/Datepicker';\nimport { HeaderTexts } from '../Header/Header';\nimport { HangerTexts } from '../Hanger/Hanger';\nimport { SelectTexts } from '../Select/Select';\nimport { TourTexts } from '../Tour/Tour';\nimport { TableTexts } from '../Table/Table';\nimport { Table2Texts } from '../Table2/Table2';\nimport { SearchInputTexts } from '../SearchInput/SearchInput';\nimport { Select2Texts } from '../Select2/Select2';\nimport { BannerTexts } from '../Banner/Banner';\n\nexport type LocalizationTexts = {\n /** Localized texts and aria-labels for [Banner](component:banner) component */\n banner: BannerTexts;\n /** Localized texts and aria-labels for [Calendar](component:calendar) component */\n calendar: CalendarTexts;\n /** Localized texts and aria-labels for [Combobox](component:combobox) component */\n combobox: ComboboxTexts;\n /** Localized texts and aria-labels for [DatePicker](component:datepicker) component */\n datepicker: DatepickerTexts;\n /** Localized texts and aria-labels for [Dialog](component:dialog) component */\n dialog: DialogTexts;\n /** Localized texts and aria-labels for [Hanger](component:hanger) component */\n hanger: HangerTexts;\n /** Localized texts and aria-labels for [Header](component:header) component */\n header: HeaderTexts;\n /** Localized texts and aria-labels for [Listbox](component:listbox) component */\n listbox: ListboxTexts;\n /** Localized texts and aria-labels for [Pagination](component:pagination) component */\n pagination: PaginationTexts;\n /** Localized texts and aria-labels for [Table](component:table) component */\n table: TableTexts;\n /** Localized texts and aria-labels for [Table2](component:table2) component */\n table2: Table2Texts;\n /** Localized texts and aria-labels for [SearchInput](component:searchinput) component */\n searchInput: SearchInputTexts;\n /** Localized texts and aria-labels for [Select](component:select) component */\n select: SelectTexts;\n /** Localized texts and aria-labels for [Select2](component:select2) component */\n select2: Select2Texts;\n /** Localized texts and aria-labels for [Toast](component:toast) component */\n toasts: ToastsTexts;\n /** Localized texts and aria-labels for [Tour](component:tour) component */\n tour: TourTexts;\n};\n\nexport type Localization = {\n /**\n * Provide the language code used in application.\n * Default value is `en-GB`\n */\n locale: Locale;\n /** Provide the texts and aria-labels for components used within the provider */\n texts: LocalizationTexts;\n /** Provide the formatting */\n formatting: {\n /** Default value is `dd.mm.yy` */\n date: string;\n };\n};\n\nexport const defaultLocalisationTexts = {\n banner: {\n close: 'Close',\n },\n calendar: {\n months: [\n 'January',\n 'February',\n 'March',\n 'April',\n 'May',\n 'June',\n 'July',\n 'August',\n 'September',\n 'October',\n 'November',\n 'December',\n ],\n weekdaysShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],\n actions: {\n previousMonth: 'Previous month',\n nextMonth: 'Next month',\n previousYear: 'Previous year',\n nextYear: 'Next year',\n today: 'Today',\n },\n },\n combobox: {\n tooltip: 'Search in list',\n },\n datepicker: {\n calendar: 'Calendar',\n clear: 'Clear',\n expand: 'Show calendar',\n shortcuts: 'Shortcuts',\n },\n dialog: {\n close: 'Close',\n drag: 'Drag',\n },\n hanger: {\n close: 'Close',\n },\n header: {\n addAgreement: 'Add agreement',\n logout: 'Log off',\n more: 'More',\n new: 'New',\n search: 'Search for agreement...',\n },\n listbox: {\n loading: 'Loading results...',\n empty: 'No results found',\n allOption: 'All',\n },\n pagination: {\n label: 'Pagination',\n pageSize: 'Items per page',\n showingXofYofTotal: 'Showing [X] - [Y] of [total]',\n actions: {\n firstPage: 'Goto first page',\n firstPageWithShortcut: 'Goto first page (Home)',\n previousPage: 'Goto previous page',\n previousPageWithShortcut: 'Goto previous page (Page Up)',\n nextPage: 'Goto next page',\n nextPageWithShortcut: 'Goto next page (Page Down)',\n lastPage: 'Goto last page',\n lastPageWithShortcut: 'Goto last page (End)',\n pageX: 'Goto page [X]',\n },\n },\n table: {\n actions: 'Other actions',\n edit: 'Edit (e)',\n copy: 'Copy (c)',\n del: 'Delete (del)',\n newSubRow: 'New row (shift + n)',\n loading: 'Loading...',\n },\n table2: {\n columns: {\n actions: {\n tooltip: 'Other actions',\n },\n drag: {\n tooltip: 'Drag row',\n },\n expansion: {\n collapse: 'Collapse row',\n collapseAll: 'Collapse all rows',\n expand: 'Expand row',\n expandAll: 'Expand all rows',\n },\n select: {\n deselect: 'Deselect row',\n deselectAll: 'Deselect all rows',\n select: 'Select row',\n selectAll: 'Select all rows',\n },\n },\n columnSettings: {\n columnsOther: 'Other columns',\n columnsOtherDrop: 'Drop column here to unpin',\n columnsPinned: 'Pinned columns',\n columnsPinnedDrop: 'Drop column here to pin',\n search: 'Search column...',\n tooltip: 'Column settings',\n },\n editing: {\n button: 'Edit',\n tooltip: 'Edit',\n tooltipDisabled: 'There are no visible columns that support editing',\n rowIndicator: {\n rowWillMove: 'Row will move due to sorting',\n rowWillBeHidden: 'Row will hide due to filtering',\n rowWillMoveReasonSearch:\n 'Due to a search filter applied to this table, this row will be hidden as soon as you select another row',\n rowWillMoveReasonFilter:\n \"Due to a filter applied to the column '[COLUMN]', this row will be hidden as soon as you select another row\",\n rowWillMoveReasonSorting:\n \"Due to sorting applied to the column '[COLUMN]', this row will move position as soon as you select another row\",\n },\n },\n filters: {\n button: 'Filters',\n buttons: {\n addFilter: 'Add Filter',\n clearFilters: 'Clear all filters',\n },\n comparators: {\n contains: 'Contains',\n doesNotContain: 'Does not contain',\n isEqualTo: 'Is',\n isNotEqualTo: 'Is not',\n isGreaterThan: 'Is greater than',\n isLessThan: 'Is less than',\n isBetween: 'Is between',\n isOneOf: 'Is one of',\n isNoneOf: 'Is none of',\n isAllOf: 'Is all of',\n isEmpty: 'Is empty',\n isNotEmpty: 'Is not empty',\n },\n tooltip: 'Apply filters',\n total: 'Viewing [CURRENT] of [TOTAL]',\n },\n rowDensity: {\n tooltip: 'Row density',\n },\n search: {\n placeholder: 'Search...',\n },\n shortcuts: {\n tooltip: 'View keyboard shortcuts',\n search: 'Search',\n filter: 'Filter',\n previousRow: 'Previous row',\n nextRow: 'Next row',\n editCell: 'Edit cell',\n previousColumn: 'Previous column',\n nextColumn: 'Next column',\n rowClick: 'Activate current row',\n selectRow: 'Select current row',\n selectAllRows: 'Select all rows',\n expandRow: 'Expand current row',\n collapseRow: 'Collapse current row',\n },\n },\n searchInput: {\n button: 'Search',\n placeholder: 'Search...',\n clear: 'Clear',\n },\n select: {\n allOptionsSelected: 'All',\n },\n select2: {\n allSelect: 'Select all',\n allDeselect: 'Deselect all',\n cancel: 'Cancel',\n chooseColor: 'Pick a color',\n create: 'Create',\n delete: 'Delete',\n save: 'Save',\n search: 'Search...',\n searchOrCreate: 'Search or create...',\n },\n toasts: {\n dismiss: 'Dismiss',\n },\n tour: {\n back: 'Back',\n close: 'Close',\n skip: 'Close and complete',\n last: 'Done',\n next: 'Next',\n open: 'Open',\n },\n};\n\nconst defaultLocalizationContext: Localization = {\n locale: 'en-GB',\n texts: defaultLocalisationTexts,\n formatting: {\n date: 'dd.mm.yy',\n },\n};\n\nexport const LocalizationContext = React.createContext<Localization>(defaultLocalizationContext);\nexport interface LocalizationProviderProps {\n children: React.ReactNode;\n localization?: Localization;\n}\nexport const LocalizationProvider: React.FC<LocalizationProviderProps> = ({ localization, children }) => {\n return (\n <LocalizationContext.Provider value={localization ?? defaultLocalizationContext}>{children}</LocalizationContext.Provider>\n );\n};\n\nexport const useLocalization = () => React.useContext(LocalizationContext);\n"],"names":["defaultLocalisationTexts","banner","close","calendar","months","weekdaysShort","actions","previousMonth","nextMonth","previousYear","nextYear","today","combobox","tooltip","datepicker","clear","expand","shortcuts","dialog","drag","hanger","header","addAgreement","logout","more","new","search","listbox","loading","empty","allOption","pagination","label","pageSize","showingXofYofTotal","firstPage","firstPageWithShortcut","previousPage","previousPageWithShortcut","nextPage","nextPageWithShortcut","lastPage","lastPageWithShortcut","pageX","table","edit","copy","del","newSubRow","table2","columns","expansion","collapse","collapseAll","expandAll","select","deselect","deselectAll","selectAll","columnSettings","columnsOther","columnsOtherDrop","columnsPinned","columnsPinnedDrop","editing","button","tooltipDisabled","rowIndicator","rowWillMove","rowWillBeHidden","rowWillMoveReasonSearch","rowWillMoveReasonFilter","rowWillMoveReasonSorting","filters","buttons","addFilter","clearFilters","comparators","contains","doesNotContain","isEqualTo","isNotEqualTo","isGreaterThan","isLessThan","isBetween","isOneOf","isNoneOf","isAllOf","isEmpty","isNotEmpty","total","rowDensity","placeholder","filter","previousRow","nextRow","editCell","previousColumn","nextColumn","rowClick","selectRow","selectAllRows","expandRow","collapseRow","searchInput","allOptionsSelected","select2","allSelect","allDeselect","cancel","chooseColor","create","delete","save","searchOrCreate","toasts","dismiss","tour","back","skip","last","next","open","defaultLocalizationContext","locale","texts","formatting","date","LocalizationContext","React","LocalizationProvider","localization","children","Provider","value","useLocalization"],"mappings":";;MAqEaA,wBAAwB,GAAG;EACpCC,MAAM,EAAE;IACJC,KAAK,EAAE;GACV;EACDC,QAAQ,EAAE;IACNC,MAAM,EAAE,CACJ,SAAS,EACT,UAAU,EACV,OAAO,EACP,OAAO,EACP,KAAK,EACL,MAAM,EACN,MAAM,EACN,QAAQ,EACR,WAAW,EACX,SAAS,EACT,UAAU,EACV,UAAU,CACb;IACDC,aAAa,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC;IAChEC,OAAO,EAAE;MACLC,aAAa,EAAE,gBAAgB;MAC/BC,SAAS,EAAE,YAAY;MACvBC,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AKlFO,oBAAoB,GAAwC,CAAC;EAAEC,YAAY;EAAEC;CAAU;EAChG,oBACIH,cAACD,mBAAmB,CAACK,QAAQ;IAACC,KAAK,EAAEH,YAAY,aAAZA,YAAY,cAAZA,YAAY,GAAIR;KAA6BS,QAAQ,CAAgC;AAElI;MAEaG,eAAe,GAAG,MAAMN,UAAgB,CAACD,mBAAmB;;;;"}
@@ -22,12 +22,15 @@ const SearchInput = /*#__PURE__*/forwardRef(function SearchInput({
22
22
  };
23
23
  const handleKeyDown = event => {
24
24
  var _props$onKeyDown;
25
+ (_props$onKeyDown = props.onKeyDown) === null || _props$onKeyDown === void 0 ? void 0 : _props$onKeyDown.call(props, event);
26
+ if (event.isDefaultPrevented()) {
27
+ return;
28
+ }
25
29
  if (event.key === 'Enter') {
26
30
  event.preventDefault();
27
31
  handleClick();
28
32
  return;
29
33
  }
30
- (_props$onKeyDown = props.onKeyDown) === null || _props$onKeyDown === void 0 ? void 0 : _props$onKeyDown.call(props, event);
31
34
  };
32
35
  return /*#__PURE__*/createElement(Input, Object.assign({
33
36
  "aria-label": texts.searchInput.placeholder,
@@ -1 +1 @@
1
- {"version":3,"file":"SearchInput.js","sources":["../../../../../../../src/components/SearchInput/SearchInput.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Input, InputProps } from '../Input/Input';\nimport { useLocalization } from '../Provider/Localization';\nimport { IconButton } from '../IconButton/IconButton';\nimport { useMergedRef } from '../../hooks/useMergedRef';\nimport { setInputValueByRef } from '../../utils/input';\n\nexport type SearchInputTexts = {\n button: string;\n clear: string;\n placeholder: string;\n};\n\nexport type SearchInputProps = Omit<InputProps, 'button' | 'icon' | 'prefix' | 'postfix'> & {\n /** Current input value will be passed to the method. In order to get the value, the component must be controlled otherwise value will always be undefined */\n onSearch?: (value: string | number | readonly string[] | undefined) => void;\n};\n\nexport const SearchInput = React.forwardRef(function SearchInput(\n { onSearch, ...props }: SearchInputProps,\n ref: React.Ref<HTMLInputElement>\n) {\n const internalRef = useMergedRef<HTMLInputElement>(ref);\n const { texts } = useLocalization();\n\n const handleClick = (): void => {\n onSearch?.(internalRef.current?.value ?? '');\n };\n\n const handleCancelClick = (): void => {\n setInputValueByRef(internalRef.current, '');\n };\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>): void => {\n if (event.key === 'Enter') {\n event.preventDefault();\n handleClick();\n return;\n }\n\n props.onKeyDown?.(event);\n };\n\n return (\n <Input\n aria-label={texts.searchInput.placeholder}\n placeholder={texts.searchInput.placeholder}\n {...props}\n onKeyDown={handleKeyDown}\n postfix={\n <>\n {props.disabled || props.readOnly || !props.value ? null : (\n <IconButton\n aria-hidden\n className=\"group-peer-focus:visible group-peer-hover:visible !text-grey-700 invisible mr-0.5 !h-5 !min-h-[theme(spacing.4)] !w-5 !min-w-[theme(spacing.4)] text-xs hover:visible group-hover:visible\"\n icon=\"close\"\n onClick={handleCancelClick}\n rounded\n tabIndex={-1}\n tooltip={texts.searchInput.clear}\n />\n )}\n <IconButton\n aria-label={texts.searchInput.button}\n icon=\"search\"\n className=\"group-peer-focus:!border-transparent group-peer-focus:group-peer-active:!border-transparent -mr-2 !border-transparent !bg-transparent focus:!border-transparent\"\n disabled={props.disabled || props.readOnly}\n onClick={handleClick}\n tabIndex={-1}\n tooltip={texts.searchInput.button}\n />\n </>\n }\n ref={internalRef}\n type=\"search\"\n />\n );\n});\n"],"names":["SearchInput","React","onSearch","props","ref","internalRef","useMergedRef","texts","useLocalization","handleClick","current","value","handleCancelClick","setInputValueByRef","handleKeyDown","event","key","preventDefault","onKeyDown","Input","searchInput","placeholder","postfix","disabled","readOnly","IconButton","className","icon","onClick","rounded","tabIndex","tooltip","clear","button","type"],"mappings":";;;;;;;MAkBaA,WAAW,gBAAGC,UAAgB,CAAC,SAASD,WAAW,CAC5D;EAAEE,QAAQ;EAAE,GAAGC;CAAyB,EACxCC,GAAgC;EAEhC,MAAMC,WAAW,GAAGC,YAAY,CAAmBF,GAAG,CAAC;EACvD,MAAM;IAAE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K,CAACa,WAAW,CAACa;MAC7B,CACH;IAEP7B,GAAG,EAAEC,WAAW;IAChB6B,IAAI,EAAC;KACP;AAEV,CAAC;;;;"}
1
+ {"version":3,"file":"SearchInput.js","sources":["../../../../../../../src/components/SearchInput/SearchInput.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Input, InputProps } from '../Input/Input';\nimport { useLocalization } from '../Provider/Localization';\nimport { IconButton } from '../IconButton/IconButton';\nimport { useMergedRef } from '../../hooks/useMergedRef';\nimport { setInputValueByRef } from '../../utils/input';\n\nexport type SearchInputTexts = {\n button: string;\n clear: string;\n placeholder: string;\n};\n\nexport type SearchInputProps = Omit<InputProps, 'button' | 'icon' | 'prefix' | 'postfix'> & {\n /** Current input value will be passed to the method. In order to get the value, the component must be controlled otherwise value will always be undefined */\n onSearch?: (value: string | number | readonly string[] | undefined) => void;\n};\n\nexport const SearchInput = React.forwardRef(function SearchInput(\n { onSearch, ...props }: SearchInputProps,\n ref: React.Ref<HTMLInputElement>\n) {\n const internalRef = useMergedRef<HTMLInputElement>(ref);\n const { texts } = useLocalization();\n\n const handleClick = (): void => {\n onSearch?.(internalRef.current?.value ?? '');\n };\n\n const handleCancelClick = (): void => {\n setInputValueByRef(internalRef.current, '');\n };\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>): void => {\n props.onKeyDown?.(event);\n\n if (event.isDefaultPrevented()) {\n return;\n }\n\n if (event.key === 'Enter') {\n event.preventDefault();\n handleClick();\n return;\n }\n };\n\n return (\n <Input\n aria-label={texts.searchInput.placeholder}\n placeholder={texts.searchInput.placeholder}\n {...props}\n onKeyDown={handleKeyDown}\n postfix={\n <>\n {props.disabled || props.readOnly || !props.value ? null : (\n <IconButton\n aria-hidden\n className=\"group-peer-focus:visible group-peer-hover:visible !text-grey-700 invisible mr-0.5 !h-5 !min-h-[theme(spacing.4)] !w-5 !min-w-[theme(spacing.4)] text-xs hover:visible group-hover:visible\"\n icon=\"close\"\n onClick={handleCancelClick}\n rounded\n tabIndex={-1}\n tooltip={texts.searchInput.clear}\n />\n )}\n <IconButton\n aria-label={texts.searchInput.button}\n icon=\"search\"\n className=\"group-peer-focus:!border-transparent group-peer-focus:group-peer-active:!border-transparent -mr-2 !border-transparent !bg-transparent focus:!border-transparent\"\n disabled={props.disabled || props.readOnly}\n onClick={handleClick}\n tabIndex={-1}\n tooltip={texts.searchInput.button}\n />\n </>\n }\n ref={internalRef}\n type=\"search\"\n />\n );\n});\n"],"names":["SearchInput","React","onSearch","props","ref","internalRef","useMergedRef","texts","useLocalization","handleClick","current","value","handleCancelClick","setInputValueByRef","handleKeyDown","event","onKeyDown","isDefaultPrevented","key","preventDefault","Input","searchInput","placeholder","postfix","disabled","readOnly","IconButton","className","icon","onClick","rounded","tabIndex","tooltip","clear","button","type"],"mappings":";;;;;;;MAkBaA,WAAW,gBAAGC,UAAgB,CAAC,SAASD,WAAW,CAC5D;EAAEE,QAAQ;EAAE,GAAGC;CAAyB,EACxCC,GAAgC;EAEhC,MAAMC,WAAW,GAAGC,YAAY,CAAmBF,GAAG,CAAC;EACvD,MAAM;IAAEG;GAAO,GAAGC,eAAe,EAAE;EAEnC,MAAMC,WAAW,GAAG;;IAChBP,QAAQ,aAARA,QAAQ,uBAARA,QAAQ,kDAAGG,WAAW,CAACK,OAAO,yDAAnB,qBAAqBC,KAAK,yEAAI,EAAE,CAAC;GAC/C;EAED,MAAMC,iBAAiB,GAAG;IACtBC,kBAAkB,CAACR,WAAW,CAACK,OAAO,EAAE,EAAE,CAAC;GAC9C;EAED,MAAMI,aAAa,GAAIC,KAA4C;;IAC/D,oBAAAZ,KAAK,CAACa,SAAS,qDAAf,sBAAAb,KAAK,EAAaY,KAAK,CAAC;IAExB,IAAIA,KAAK,CAACE,kBAAkB,EAAE,EAAE;MAC5B;;IAGJ,IAAIF,KAAK,CAACG,GAAG,KAAK,OAAO,EAAE;MACvBH,KAAK,CAACI,cAAc,EAAE;MACtBV,WAAW,EAAE;MACb;;GAEP;EAED,oBACIR,cAACmB,KAAK;kBACUb,KAAK,CAACc,WAAW,CAACC,WAAW;IACzCA,WAAW,EAAEf,KAAK,CAACc,WAAW,CAACC;KAC3BnB,KAAK;IACTa,SAAS,EAAEF,aAAa;IACxBS,OAAO,eACHtB,8BACKE,KAAK,CAACqB,QAAQ,IAAIrB,KAAK,CAACsB,QAAQ,IAAI,CAACtB,KAAK,CAACQ,KAAK,GAAG,IAAI,gBACpDV,cAACyB,UAAU;;MAEPC,SAAS,EAAC,2LAA2L;MACrMC,IAAI,EAAC,OAAO;MACZC,OAAO,EAAEjB,iBAAiB;MAC1BkB,OAAO;MACPC,QAAQ,EAAE,CAAC,CAAC;MACZC,OAAO,EAAEzB,KAAK,CAACc,WAAW,CAACY;MAElC,eACDhC,cAACyB,UAAU;oBACKnB,KAAK,CAACc,WAAW,CAACa,MAAM;MACpCN,IAAI,EAAC,QAAQ;MACbD,SAAS,EAAC,iKAAiK;MAC3KH,QAAQ,EAAErB,KAAK,CAACqB,QAAQ,IAAIrB,KAAK,CAACsB,QAAQ;MAC1CI,OAAO,EAAEpB,WAAW;MACpBsB,QAAQ,EAAE,CAAC,CAAC;MACZC,OAAO,EAAEzB,KAAK,CAACc,WAAW,CAACa;MAC7B,CACH;IAEP9B,GAAG,EAAEC,WAAW;IAChB8B,IAAI,EAAC;KACP;AAEV,CAAC;;;;"}
@@ -1,14 +1,16 @@
1
1
  import React__default from 'react';
2
+ import { useBoundingClientRectListener } from './useBoundingClientRectListener.js';
2
3
  import { getIndexOfFirstChildOverflowingParent } from '../utils/dom.js';
3
4
 
4
5
  const useBoundaryOverflowDetection = (ref, dependencies = []) => {
5
6
  const [boundaryIndex, setBoundaryIndex] = React__default.useState();
7
+ const dimensions = useBoundingClientRectListener(ref, dependencies);
6
8
  React__default.useEffect(() => {
7
9
  if (ref.current) {
8
10
  const boundaryChildIndex = getIndexOfFirstChildOverflowingParent(ref.current);
9
11
  setBoundaryIndex(boundaryChildIndex);
10
12
  }
11
- }, [ref, ...dependencies]);
13
+ }, [ref, dimensions === null || dimensions === void 0 ? void 0 : dimensions.width, ...dependencies]);
12
14
  return boundaryIndex;
13
15
  };
14
16
 
@@ -1 +1 @@
1
- {"version":3,"file":"useBoundaryOverflowDetection.js","sources":["../../../../../../src/hooks/useBoundaryOverflowDetection.ts"],"sourcesContent":["import React from 'react';\nimport { getIndexOfFirstChildOverflowingParent } from '../utils/dom';\n\nexport const useBoundaryOverflowDetection = (\n ref: React.RefObject<HTMLElement>,\n dependencies: any[] = []\n): number | null | undefined => {\n const [boundaryIndex, setBoundaryIndex] = React.useState<number | null>();\n\n React.useEffect(() => {\n if (ref.current) {\n const boundaryChildIndex = getIndexOfFirstChildOverflowingParent(ref.current);\n setBoundaryIndex(boundaryChildIndex);\n }\n }, [ref, ...dependencies]);\n\n return boundaryIndex;\n};\n"],"names":["useBoundaryOverflowDetection","ref","dependencies","boundaryIndex","setBoundaryIndex","React","useState","useEffect","current","boundaryChildIndex","getIndexOfFirstChildOverflowingParent"],"mappings":";;;MAGaA,4BAA4B,GAAG,CACxCC,GAAiC,EACjCC,eAAsB,EAAE;EAExB,MAAM,CAACC,aAAa,EAAEC,gBAAgB,CAAC,GAAGC,cAAK,CAACC,QAAQ,EAAiB;EAEzED,cAAK,CAACE,SAAS,CAAC;IACZ,IAAIN,GAAG,CAACO,OAAO,EAAE;MACb,MAAMC,kBAAkB,GAAGC,qCAAqC,CAACT,GAAG,CAACO,OAAO,CAAC;MAC7EJ,gBAAgB,CAACK,kBAAkB,CAAC;;GAE3C,EAAE,CAACR,GAAG,EAAE,GAAGC,YAAY,CAAC,CAAC;EAE1B,OAAOC,aAAa;AACxB;;;;"}
1
+ {"version":3,"file":"useBoundaryOverflowDetection.js","sources":["../../../../../../src/hooks/useBoundaryOverflowDetection.ts"],"sourcesContent":["import React from 'react';\nimport { getIndexOfFirstChildOverflowingParent } from '../utils/dom';\nimport { useBoundingClientRectListener } from './useBoundingClientRectListener';\n\nexport const useBoundaryOverflowDetection = (\n ref: React.RefObject<HTMLElement>,\n dependencies: any[] = []\n): number | null | undefined => {\n const [boundaryIndex, setBoundaryIndex] = React.useState<number | null>();\n const dimensions = useBoundingClientRectListener(ref, dependencies);\n\n React.useEffect(() => {\n if (ref.current) {\n const boundaryChildIndex = getIndexOfFirstChildOverflowingParent(ref.current);\n setBoundaryIndex(boundaryChildIndex);\n }\n }, [ref, dimensions?.width, ...dependencies]);\n\n return boundaryIndex;\n};\n"],"names":["useBoundaryOverflowDetection","ref","dependencies","boundaryIndex","setBoundaryIndex","React","useState","dimensions","useBoundingClientRectListener","useEffect","current","boundaryChildIndex","getIndexOfFirstChildOverflowingParent","width"],"mappings":";;;;MAIaA,4BAA4B,GAAG,CACxCC,GAAiC,EACjCC,eAAsB,EAAE;EAExB,MAAM,CAACC,aAAa,EAAEC,gBAAgB,CAAC,GAAGC,cAAK,CAACC,QAAQ,EAAiB;EACzE,MAAMC,UAAU,GAAGC,6BAA6B,CAACP,GAAG,EAAEC,YAAY,CAAC;EAEnEG,cAAK,CAACI,SAAS,CAAC;IACZ,IAAIR,GAAG,CAACS,OAAO,EAAE;MACb,MAAMC,kBAAkB,GAAGC,qCAAqC,CAACX,GAAG,CAACS,OAAO,CAAC;MAC7EN,gBAAgB,CAACO,kBAAkB,CAAC;;GAE3C,EAAE,CAACV,GAAG,EAAEM,UAAU,aAAVA,UAAU,uBAAVA,UAAU,CAAEM,KAAK,EAAE,GAAGX,YAAY,CAAC,CAAC;EAE7C,OAAOC,aAAa;AACxB;;;;"}