@neo4j-ndl/react 4.21.1 → 4.21.2-alpha.585cb7c.16.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/lib/cjs/accordion/stories/accordion-full.story.js +1 -1
- package/lib/cjs/accordion/stories/accordion-full.story.js.map +1 -1
- package/lib/cjs/ai/preview/Preview.js +1 -1
- package/lib/cjs/ai/preview/Preview.js.map +1 -1
- package/lib/cjs/ai/reasoning/Reasoning.js +2 -2
- package/lib/cjs/ai/reasoning/Reasoning.js.map +1 -1
- package/lib/cjs/ai/thinking/Thinking.js +1 -1
- package/lib/cjs/ai/thinking/Thinking.js.map +1 -1
- package/lib/cjs/avatar/Avatar.js +1 -1
- package/lib/cjs/avatar/Avatar.js.map +1 -1
- package/lib/cjs/banner/Banner.js +1 -1
- package/lib/cjs/banner/Banner.js.map +1 -1
- package/lib/cjs/clean-icon-button/stories/clean-icon-button-sizes.story.js +1 -1
- package/lib/cjs/clean-icon-button/stories/clean-icon-button-sizes.story.js.map +1 -1
- package/lib/cjs/clean-icon-button/stories/clean-icon-button-tone.story.js +1 -1
- package/lib/cjs/clean-icon-button/stories/clean-icon-button-tone.story.js.map +1 -1
- package/lib/cjs/data-grid/Components.js +1 -1
- package/lib/cjs/data-grid/Components.js.map +1 -1
- package/lib/cjs/data-grid/stories/datagrid-search-and-filters.stories.js +1 -1
- package/lib/cjs/data-grid/stories/datagrid-search-and-filters.stories.js.map +1 -1
- package/lib/cjs/date-picker/DatePicker.js +2 -2
- package/lib/cjs/date-picker/DatePicker.js.map +1 -1
- package/lib/cjs/date-picker/stories/date-picker-with-timezone-both-mode.story.js +2 -2
- package/lib/cjs/date-picker/stories/date-picker-with-timezone-both-mode.story.js.map +1 -1
- package/lib/cjs/drawer/Drawer.js +1 -1
- package/lib/cjs/drawer/Drawer.js.map +1 -1
- package/lib/cjs/dropzone/Dropzone.js +2 -2
- package/lib/cjs/dropzone/Dropzone.js.map +1 -1
- package/lib/cjs/dropzone/stories/dropzone-full.story.js +7 -7
- package/lib/cjs/dropzone/stories/dropzone-full.story.js.map +1 -1
- package/lib/cjs/icon-button/stories/icon-button-sizes.story.js +1 -1
- package/lib/cjs/icon-button/stories/icon-button-sizes.story.js.map +1 -1
- package/lib/cjs/icon-button/stories/icon-button-tone.story.js +1 -1
- package/lib/cjs/icon-button/stories/icon-button-tone.story.js.map +1 -1
- package/lib/cjs/radio/stories/radio-custom-label.story.js +1 -1
- package/lib/cjs/radio/stories/radio-custom-label.story.js.map +1 -1
- package/lib/cjs/select-icon-button/stories/select-icon-button-sizes.story.js +1 -1
- package/lib/cjs/select-icon-button/stories/select-icon-button-sizes.story.js.map +1 -1
- package/lib/cjs/select-icon-button/stories/select-icon-button-states.story.js +1 -1
- package/lib/cjs/select-icon-button/stories/select-icon-button-states.story.js.map +1 -1
- package/lib/cjs/side-navigation/SideNavigation.js +2 -2
- package/lib/cjs/side-navigation/SideNavigation.js.map +1 -1
- package/lib/cjs/side-navigation/stories/side-nav-badges.story.js +1 -1
- package/lib/cjs/side-navigation/stories/side-nav-badges.story.js.map +1 -1
- package/lib/cjs/side-navigation/stories/side-nav-compact.story.js +1 -1
- package/lib/cjs/side-navigation/stories/side-nav-compact.story.js.map +1 -1
- package/lib/cjs/side-navigation/stories/side-nav-default.story.js +1 -1
- package/lib/cjs/side-navigation/stories/side-nav-default.story.js.map +1 -1
- package/lib/cjs/side-navigation/stories/side-nav-secondary.story.js +1 -1
- package/lib/cjs/side-navigation/stories/side-nav-secondary.story.js.map +1 -1
- package/lib/cjs/skeleton/stories/skeleton-full-example.story.js +1 -1
- package/lib/cjs/skeleton/stories/skeleton-full-example.story.js.map +1 -1
- package/lib/cjs/skeleton/stories/skeleton-inherit-width.story.js +1 -1
- package/lib/cjs/skeleton/stories/skeleton-inherit-width.story.js.map +1 -1
- package/lib/cjs/spotlight/Spotlight.js +1 -1
- package/lib/cjs/spotlight/Spotlight.js.map +1 -1
- package/lib/cjs/status-indicator/stories/status-indicator-variants.story.js +1 -1
- package/lib/cjs/status-indicator/stories/status-indicator-variants.story.js.map +1 -1
- package/lib/cjs/tabs/Tabs.js +1 -1
- package/lib/cjs/tabs/Tabs.js.map +1 -1
- package/lib/cjs/tabs/stories/tabs-fill-variants.story.js +1 -1
- package/lib/cjs/tabs/stories/tabs-fill-variants.story.js.map +1 -1
- package/lib/cjs/tabs/stories/tabs-sizes.story.js +1 -1
- package/lib/cjs/tabs/stories/tabs-sizes.story.js.map +1 -1
- package/lib/cjs/timezone-picker/stories/timezone-picker-both-mode.story.js +1 -1
- package/lib/cjs/timezone-picker/stories/timezone-picker-both-mode.story.js.map +1 -1
- package/lib/cjs/tree-view/TreeViewTextItem.js +1 -1
- package/lib/cjs/tree-view/TreeViewTextItem.js.map +1 -1
- package/lib/cjs/typography/Typography.js.map +1 -1
- package/lib/cjs/typography/stories/typography-anchor.story.js +1 -1
- package/lib/cjs/typography/stories/typography-anchor.story.js.map +1 -1
- package/lib/esm/accordion/stories/accordion-full.story.js +1 -1
- package/lib/esm/accordion/stories/accordion-full.story.js.map +1 -1
- package/lib/esm/ai/preview/Preview.js +1 -1
- package/lib/esm/ai/preview/Preview.js.map +1 -1
- package/lib/esm/ai/reasoning/Reasoning.js +2 -2
- package/lib/esm/ai/reasoning/Reasoning.js.map +1 -1
- package/lib/esm/ai/thinking/Thinking.js +1 -1
- package/lib/esm/ai/thinking/Thinking.js.map +1 -1
- package/lib/esm/avatar/Avatar.js +1 -1
- package/lib/esm/avatar/Avatar.js.map +1 -1
- package/lib/esm/banner/Banner.js +1 -1
- package/lib/esm/banner/Banner.js.map +1 -1
- package/lib/esm/clean-icon-button/stories/clean-icon-button-sizes.story.js +1 -1
- package/lib/esm/clean-icon-button/stories/clean-icon-button-sizes.story.js.map +1 -1
- package/lib/esm/clean-icon-button/stories/clean-icon-button-tone.story.js +1 -1
- package/lib/esm/clean-icon-button/stories/clean-icon-button-tone.story.js.map +1 -1
- package/lib/esm/data-grid/Components.js +1 -1
- package/lib/esm/data-grid/Components.js.map +1 -1
- package/lib/esm/data-grid/stories/datagrid-search-and-filters.stories.js +1 -1
- package/lib/esm/data-grid/stories/datagrid-search-and-filters.stories.js.map +1 -1
- package/lib/esm/date-picker/DatePicker.js +2 -2
- package/lib/esm/date-picker/DatePicker.js.map +1 -1
- package/lib/esm/date-picker/stories/date-picker-with-timezone-both-mode.story.js +2 -2
- package/lib/esm/date-picker/stories/date-picker-with-timezone-both-mode.story.js.map +1 -1
- package/lib/esm/drawer/Drawer.js +1 -1
- package/lib/esm/drawer/Drawer.js.map +1 -1
- package/lib/esm/dropzone/Dropzone.js +2 -2
- package/lib/esm/dropzone/Dropzone.js.map +1 -1
- package/lib/esm/dropzone/stories/dropzone-full.story.js +7 -7
- package/lib/esm/dropzone/stories/dropzone-full.story.js.map +1 -1
- package/lib/esm/icon-button/stories/icon-button-sizes.story.js +1 -1
- package/lib/esm/icon-button/stories/icon-button-sizes.story.js.map +1 -1
- package/lib/esm/icon-button/stories/icon-button-tone.story.js +1 -1
- package/lib/esm/icon-button/stories/icon-button-tone.story.js.map +1 -1
- package/lib/esm/radio/stories/radio-custom-label.story.js +1 -1
- package/lib/esm/radio/stories/radio-custom-label.story.js.map +1 -1
- package/lib/esm/select-icon-button/stories/select-icon-button-sizes.story.js +1 -1
- package/lib/esm/select-icon-button/stories/select-icon-button-sizes.story.js.map +1 -1
- package/lib/esm/select-icon-button/stories/select-icon-button-states.story.js +1 -1
- package/lib/esm/select-icon-button/stories/select-icon-button-states.story.js.map +1 -1
- package/lib/esm/side-navigation/SideNavigation.js +2 -2
- package/lib/esm/side-navigation/SideNavigation.js.map +1 -1
- package/lib/esm/side-navigation/stories/side-nav-badges.story.js +1 -1
- package/lib/esm/side-navigation/stories/side-nav-badges.story.js.map +1 -1
- package/lib/esm/side-navigation/stories/side-nav-compact.story.js +1 -1
- package/lib/esm/side-navigation/stories/side-nav-compact.story.js.map +1 -1
- package/lib/esm/side-navigation/stories/side-nav-default.story.js +1 -1
- package/lib/esm/side-navigation/stories/side-nav-default.story.js.map +1 -1
- package/lib/esm/side-navigation/stories/side-nav-secondary.story.js +1 -1
- package/lib/esm/side-navigation/stories/side-nav-secondary.story.js.map +1 -1
- package/lib/esm/skeleton/stories/skeleton-full-example.story.js +1 -1
- package/lib/esm/skeleton/stories/skeleton-full-example.story.js.map +1 -1
- package/lib/esm/skeleton/stories/skeleton-inherit-width.story.js +1 -1
- package/lib/esm/skeleton/stories/skeleton-inherit-width.story.js.map +1 -1
- package/lib/esm/spotlight/Spotlight.js +1 -1
- package/lib/esm/spotlight/Spotlight.js.map +1 -1
- package/lib/esm/status-indicator/stories/status-indicator-variants.story.js +1 -1
- package/lib/esm/status-indicator/stories/status-indicator-variants.story.js.map +1 -1
- package/lib/esm/tabs/Tabs.js +1 -1
- package/lib/esm/tabs/Tabs.js.map +1 -1
- package/lib/esm/tabs/stories/tabs-fill-variants.story.js +1 -1
- package/lib/esm/tabs/stories/tabs-fill-variants.story.js.map +1 -1
- package/lib/esm/tabs/stories/tabs-sizes.story.js +1 -1
- package/lib/esm/tabs/stories/tabs-sizes.story.js.map +1 -1
- package/lib/esm/timezone-picker/stories/timezone-picker-both-mode.story.js +1 -1
- package/lib/esm/timezone-picker/stories/timezone-picker-both-mode.story.js.map +1 -1
- package/lib/esm/tree-view/TreeViewTextItem.js +1 -1
- package/lib/esm/tree-view/TreeViewTextItem.js.map +1 -1
- package/lib/esm/typography/Typography.js.map +1 -1
- package/lib/esm/typography/stories/typography-anchor.story.js +1 -1
- package/lib/esm/typography/stories/typography-anchor.story.js.map +1 -1
- package/lib/types/typography/Typography.d.ts +6 -1
- package/lib/types/typography/Typography.d.ts.map +1 -1
- package/package.json +2 -2
- package/skills/ndl-react/components/clean-icon-button.md +5 -5
- package/skills/ndl-react/components/color-picker.md +32 -32
- package/skills/ndl-react/components/date-picker.md +1 -1
- package/skills/ndl-react/components/dropzone.md +6 -6
- package/skills/ndl-react/components/icon-button.md +5 -5
- package/skills/ndl-react/components/radio.md +1 -1
- package/skills/ndl-react/components/select-icon-button.md +6 -6
- package/skills/ndl-react/components/status-indicator.md +5 -5
- package/skills/ndl-react/components/tabs.md +4 -4
- package/skills/ndl-react/components/typography.md +1 -1
|
@@ -25,7 +25,7 @@ import { useState } from 'react';
|
|
|
25
25
|
const Component = () => {
|
|
26
26
|
const [smallValue, setSmallValue] = useState('0');
|
|
27
27
|
const [largeValue, setLargeValue] = useState('0');
|
|
28
|
-
return (_jsxs("div", { className: "n-flex n-gap-token-8", children: [_jsxs("div", { className: "n-flex n-flex-col n-gap-token-8", children: [_jsx(Typography, { variant: "
|
|
28
|
+
return (_jsxs("div", { className: "n-flex n-gap-token-8", children: [_jsxs("div", { className: "n-flex n-flex-col n-gap-token-8", children: [_jsx(Typography, { variant: "title-3", children: "Small Size" }), _jsxs("div", { className: "n-w-fit", children: [_jsxs(Tabs, { value: smallValue, onChange: setSmallValue, size: "small", className: "n-mb-token-8", children: [_jsx(Tabs.Tab, { id: "0", children: "Tab 1" }), _jsx(Tabs.Tab, { id: "1", children: "Tab 2" }), _jsx(Tabs.Tab, { id: "2", children: "Tab 3" })] }), _jsx(Tabs.TabPanel, { value: smallValue, tabId: "0", children: _jsx(Typography, { variant: "body-small", children: "Content for small tab 1" }) }), _jsx(Tabs.TabPanel, { value: smallValue, tabId: "1", children: _jsx(Typography, { variant: "body-small", children: "Content for small tab 2" }) }), _jsx(Tabs.TabPanel, { value: smallValue, tabId: "2", children: _jsx(Typography, { variant: "body-small", children: "Content for small tab 3" }) })] })] }), _jsxs("div", { className: "n-flex n-flex-col n-gap-token-8", children: [_jsx(Typography, { variant: "title-3", children: "Large Size (Default)" }), _jsxs(Tabs, { value: largeValue, onChange: setLargeValue, size: "large", className: "n-mb-token-8", children: [_jsx(Tabs.Tab, { id: "0", children: "Tab 1" }), _jsx(Tabs.Tab, { id: "1", children: "Tab 2" }), _jsx(Tabs.Tab, { id: "2", children: "Tab 3" })] }), _jsx(Tabs.TabPanel, { value: largeValue, tabId: "0", children: _jsx(Typography, { variant: "body-medium", children: "Content for large tab 1" }) }), _jsx(Tabs.TabPanel, { value: largeValue, tabId: "1", children: _jsx(Typography, { variant: "body-medium", children: "Content for large tab 2" }) }), _jsx(Tabs.TabPanel, { value: largeValue, tabId: "2", children: _jsx(Typography, { variant: "body-medium", children: "Content for large tab 3" }) })] })] }));
|
|
29
29
|
};
|
|
30
30
|
export default Component;
|
|
31
31
|
//# sourceMappingURL=tabs-sizes.story.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs-sizes.story.js","sourceRoot":"","sources":["../../../../src/tabs/stories/tabs-sizes.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAIjC,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAY,GAAG,CAAC,CAAC;IAC7D,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAY,GAAG,CAAC,CAAC;IAE7D,OAAO,CACL,eAAK,SAAS,EAAC,sBAAsB,aACnC,eAAK,SAAS,EAAC,iCAAiC,aAC9C,KAAC,UAAU,IAAC,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"tabs-sizes.story.js","sourceRoot":"","sources":["../../../../src/tabs/stories/tabs-sizes.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAIjC,MAAM,SAAS,GAAG,GAAG,EAAE;I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C,cAAc,aAExB,KAAC,IAAI,CAAC,GAAG,IAAC,EAAE,EAAC,GAAG,sBAAiB,EACjC,KAAC,IAAI,CAAC,GAAG,IAAC,EAAE,EAAC,GAAG,sBAAiB,EACjC,KAAC,IAAI,CAAC,GAAG,IAAC,EAAE,EAAC,GAAG,sBAAiB,IAC5B,EACP,KAAC,IAAI,CAAC,QAAQ,IAAC,KAAK,EAAE,UAAU,EAAE,KAAK,EAAC,GAAG,YACzC,KAAC,UAAU,IAAC,OAAO,EAAC,aAAa,wCAAqC,GACxD,EAChB,KAAC,IAAI,CAAC,QAAQ,IAAC,KAAK,EAAE,UAAU,EAAE,KAAK,EAAC,GAAG,YACzC,KAAC,UAAU,IAAC,OAAO,EAAC,aAAa,wCAAqC,GACxD,EAChB,KAAC,IAAI,CAAC,QAAQ,IAAC,KAAK,EAAE,UAAU,EAAE,KAAK,EAAC,GAAG,YACzC,KAAC,UAAU,IAAC,OAAO,EAAC,aAAa,wCAAqC,GACxD,IACZ,IACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport { Tabs, Typography } from '@neo4j-ndl/react';\nimport { useState } from 'react';\n\ntype TabValues = '0' | '1' | '2';\n\nconst Component = () => {\n const [smallValue, setSmallValue] = useState<TabValues>('0');\n const [largeValue, setLargeValue] = useState<TabValues>('0');\n\n return (\n <div className=\"n-flex n-gap-token-8\">\n <div className=\"n-flex n-flex-col n-gap-token-8\">\n <Typography variant=\"title-3\">Small Size</Typography>\n <div className=\"n-w-fit\">\n <Tabs\n value={smallValue}\n onChange={setSmallValue}\n size=\"small\"\n className=\"n-mb-token-8\"\n >\n <Tabs.Tab id=\"0\">Tab 1</Tabs.Tab>\n <Tabs.Tab id=\"1\">Tab 2</Tabs.Tab>\n <Tabs.Tab id=\"2\">Tab 3</Tabs.Tab>\n </Tabs>\n <Tabs.TabPanel value={smallValue} tabId=\"0\">\n <Typography variant=\"body-small\">\n Content for small tab 1\n </Typography>\n </Tabs.TabPanel>\n <Tabs.TabPanel value={smallValue} tabId=\"1\">\n <Typography variant=\"body-small\">\n Content for small tab 2\n </Typography>\n </Tabs.TabPanel>\n <Tabs.TabPanel value={smallValue} tabId=\"2\">\n <Typography variant=\"body-small\">\n Content for small tab 3\n </Typography>\n </Tabs.TabPanel>\n </div>\n </div>\n\n <div className=\"n-flex n-flex-col n-gap-token-8\">\n <Typography variant=\"title-3\">Large Size (Default)</Typography>\n <Tabs\n value={largeValue}\n onChange={setLargeValue}\n size=\"large\"\n className=\"n-mb-token-8\"\n >\n <Tabs.Tab id=\"0\">Tab 1</Tabs.Tab>\n <Tabs.Tab id=\"1\">Tab 2</Tabs.Tab>\n <Tabs.Tab id=\"2\">Tab 3</Tabs.Tab>\n </Tabs>\n <Tabs.TabPanel value={largeValue} tabId=\"0\">\n <Typography variant=\"body-medium\">Content for large tab 1</Typography>\n </Tabs.TabPanel>\n <Tabs.TabPanel value={largeValue} tabId=\"1\">\n <Typography variant=\"body-medium\">Content for large tab 2</Typography>\n </Tabs.TabPanel>\n <Tabs.TabPanel value={largeValue} tabId=\"2\">\n <Typography variant=\"body-medium\">Content for large tab 3</Typography>\n </Tabs.TabPanel>\n </div>\n </div>\n );\n};\n\nexport default Component;\n"]}
|
|
@@ -24,7 +24,7 @@ import { Typography } from '../../typography';
|
|
|
24
24
|
import { TimeZonePicker } from '../TimeZonePicker';
|
|
25
25
|
export const TimeZonePickerBothMode = () => {
|
|
26
26
|
const [selectedTimezone, setSelectedTimezone] = useState('America/New_York');
|
|
27
|
-
return (_jsxs("div", { style: { maxWidth: '400px', padding: '20px' }, children: [_jsx(Typography, { variant: "title-
|
|
27
|
+
return (_jsxs("div", { style: { maxWidth: '400px', padding: '20px' }, children: [_jsx(Typography, { variant: "title-3", style: { marginBottom: '16px' }, children: "Both Mode - UTC and City-Based Timezones" }), _jsx(Typography, { variant: "body-medium", style: { marginBottom: '24px' }, children: "This mode displays both UTC offsets and city-based timezones in separate sections within the dropdown. Perfect for users who need flexibility in choosing between precise UTC offsets or familiar city names." }), _jsx(TimeZonePicker, { label: "Select Timezone", mode: "both", value: selectedTimezone, onChange: (tz) => {
|
|
28
28
|
setSelectedTimezone(tz);
|
|
29
29
|
}, htmlAttributes: { id: 'time-zone-input' } }), _jsxs("div", { style: {
|
|
30
30
|
backgroundColor: '#f5f5f5',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timezone-picker-both-mode.story.js","sourceRoot":"","sources":["../../../../src/timezone-picker/stories/timezone-picker-both-mode.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,EAAE;IACzC,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,GAC3C,QAAQ,CAAS,kBAAkB,CAAC,CAAC;IAEvC,OAAO,CACL,eAAK,KAAK,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,aAChD,KAAC,UAAU,IAAC,OAAO,EAAC,SAAS,EAAC,KAAK,EAAE,EAAE,YAAY,EAAE,MAAM,EAAE,yDAEhD,EACb,KAAC,UAAU,IAAC,OAAO,EAAC,aAAa,EAAC,KAAK,EAAE,EAAE,YAAY,EAAE,MAAM,EAAE,8NAIpD,EAEb,KAAC,cAAc,IACb,KAAK,EAAC,iBAAiB,EACvB,IAAI,EAAC,MAAM,EACX,KAAK,EAAE,gBAAgB,EACvB,QAAQ,EAAE,CAAC,EAAE,EAAE,EAAE;oBACf,mBAAmB,CAAC,EAAE,CAAC,CAAC;gBAC1B,CAAC,EACD,cAAc,EAAE,EAAE,EAAE,EAAE,iBAAiB,EAAE,GACzC,EAEF,eACE,KAAK,EAAE;oBACL,eAAe,EAAE,SAAS;oBAC1B,YAAY,EAAE,KAAK;oBACnB,SAAS,EAAE,MAAM;oBACjB,OAAO,EAAE,MAAM;iBAChB,aAED,KAAC,UAAU,IACT,OAAO,EAAC,YAAY,EACpB,KAAK,EAAE,EAAE,UAAU,EAAE,GAAG,EAAE,YAAY,EAAE,KAAK,EAAE,mCAGpC,EACb,KAAC,UAAU,IAAC,OAAO,EAAC,aAAa,YAC9B,gBAAgB,IAAI,MAAM,GAChB,IACT,EAEN,cAAK,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,YAC/B,MAAC,UAAU,IAAC,OAAO,EAAC,YAAY,EAAC,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,aACvD,yCAA0B,EAC1B,cAAI,KAAK,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,aAClD,+FAGK,EACL,sEAAmD,EACnD,qEAAkD,EAClD,0EAAuD,EACvD,yEAAsD,IACnD,IACM,GACT,IACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,sBAAsB,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport { useState } from 'react';\n\nimport { Typography } from '../../typography';\nimport { TimeZonePicker } from '../TimeZonePicker';\n\nexport const TimeZonePickerBothMode = () => {\n const [selectedTimezone, setSelectedTimezone] =\n useState<string>('America/New_York');\n\n return (\n <div style={{ maxWidth: '400px', padding: '20px' }}>\n <Typography variant=\"title-
|
|
1
|
+
{"version":3,"file":"timezone-picker-both-mode.story.js","sourceRoot":"","sources":["../../../../src/timezone-picker/stories/timezone-picker-both-mode.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,EAAE;IACzC,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,GAC3C,QAAQ,CAAS,kBAAkB,CAAC,CAAC;IAEvC,OAAO,CACL,eAAK,KAAK,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,aAChD,KAAC,UAAU,IAAC,OAAO,EAAC,SAAS,EAAC,KAAK,EAAE,EAAE,YAAY,EAAE,MAAM,EAAE,yDAEhD,EACb,KAAC,UAAU,IAAC,OAAO,EAAC,aAAa,EAAC,KAAK,EAAE,EAAE,YAAY,EAAE,MAAM,EAAE,8NAIpD,EAEb,KAAC,cAAc,IACb,KAAK,EAAC,iBAAiB,EACvB,IAAI,EAAC,MAAM,EACX,KAAK,EAAE,gBAAgB,EACvB,QAAQ,EAAE,CAAC,EAAE,EAAE,EAAE;oBACf,mBAAmB,CAAC,EAAE,CAAC,CAAC;gBAC1B,CAAC,EACD,cAAc,EAAE,EAAE,EAAE,EAAE,iBAAiB,EAAE,GACzC,EAEF,eACE,KAAK,EAAE;oBACL,eAAe,EAAE,SAAS;oBAC1B,YAAY,EAAE,KAAK;oBACnB,SAAS,EAAE,MAAM;oBACjB,OAAO,EAAE,MAAM;iBAChB,aAED,KAAC,UAAU,IACT,OAAO,EAAC,YAAY,EACpB,KAAK,EAAE,EAAE,UAAU,EAAE,GAAG,EAAE,YAAY,EAAE,KAAK,EAAE,mCAGpC,EACb,KAAC,UAAU,IAAC,OAAO,EAAC,aAAa,YAC9B,gBAAgB,IAAI,MAAM,GAChB,IACT,EAEN,cAAK,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,YAC/B,MAAC,UAAU,IAAC,OAAO,EAAC,YAAY,EAAC,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,aACvD,yCAA0B,EAC1B,cAAI,KAAK,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,aAClD,+FAGK,EACL,sEAAmD,EACnD,qEAAkD,EAClD,0EAAuD,EACvD,yEAAsD,IACnD,IACM,GACT,IACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,sBAAsB,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport { useState } from 'react';\n\nimport { Typography } from '../../typography';\nimport { TimeZonePicker } from '../TimeZonePicker';\n\nexport const TimeZonePickerBothMode = () => {\n const [selectedTimezone, setSelectedTimezone] =\n useState<string>('America/New_York');\n\n return (\n <div style={{ maxWidth: '400px', padding: '20px' }}>\n <Typography variant=\"title-3\" style={{ marginBottom: '16px' }}>\n Both Mode - UTC and City-Based Timezones\n </Typography>\n <Typography variant=\"body-medium\" style={{ marginBottom: '24px' }}>\n This mode displays both UTC offsets and city-based timezones in separate\n sections within the dropdown. Perfect for users who need flexibility in\n choosing between precise UTC offsets or familiar city names.\n </Typography>\n\n <TimeZonePicker\n label=\"Select Timezone\"\n mode=\"both\"\n value={selectedTimezone}\n onChange={(tz) => {\n setSelectedTimezone(tz);\n }}\n htmlAttributes={{ id: 'time-zone-input' }}\n />\n\n <div\n style={{\n backgroundColor: '#f5f5f5',\n borderRadius: '4px',\n marginTop: '24px',\n padding: '16px',\n }}\n >\n <Typography\n variant=\"body-small\"\n style={{ fontWeight: 600, marginBottom: '8px' }}\n >\n Selected Timezone:\n </Typography>\n <Typography variant=\"body-medium\">\n {selectedTimezone || 'None'}\n </Typography>\n </div>\n\n <div style={{ marginTop: '16px' }}>\n <Typography variant=\"body-small\" style={{ color: '#666' }}>\n <strong>Features:</strong>\n <ul style={{ marginTop: '8px', paddingLeft: '20px' }}>\n <li>\n Two separate sections: "UTC Offsets" and\n "City-Based Timezones"\n </li>\n <li>Search across both sections simultaneously</li>\n <li>Custom UTC input support (e.g., UTC+5:30)</li>\n <li>All standard UTC offsets from UTC-12 to UTC+14</li>\n <li>All IANA timezone identifiers with city names</li>\n </ul>\n </Typography>\n </div>\n </div>\n );\n};\n\nexport default TimeZonePickerBothMode;\n"]}
|
|
@@ -134,7 +134,7 @@ export const TreeViewTextItem = (_a) => {
|
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
136
|
onItemsChanged(newItems, { item, reason: 'selected' });
|
|
137
|
-
}, "aria-label": item.data.text }) }))), _jsx(Skeleton, Object.assign({ onBackground: "weak", shape: "rectangular", height: "20px" }, item.skeletonProps, { isLoading: item.isSkeletonLoading, children: _jsx(ConditionalWrap, { shouldWrap: item.data.onTextClick !== undefined, wrap: (children) => (_jsx("button", { type: "button", onClick: item.data.onTextClick, className: "ndl-tree-view-text-clickable", tabIndex: tabIndex, children: children })), children: _jsx(Typography, { variant: item.canHaveSubItems ? 'subheading-
|
|
137
|
+
}, "aria-label": item.data.text }) }))), _jsx(Skeleton, Object.assign({ onBackground: "weak", shape: "rectangular", height: "20px" }, item.skeletonProps, { isLoading: item.isSkeletonLoading, children: _jsx(ConditionalWrap, { shouldWrap: item.data.onTextClick !== undefined, wrap: (children) => (_jsx("button", { type: "button", onClick: item.data.onTextClick, className: "ndl-tree-view-text-clickable", tabIndex: tabIndex, children: children })), children: _jsx(Typography, { variant: item.canHaveSubItems ? 'subheading-medium' : 'body-medium', htmlAttributes: {
|
|
138
138
|
style: {
|
|
139
139
|
overflow: 'hidden',
|
|
140
140
|
textOverflow: 'ellipsis',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeViewTextItem.js","sourceRoot":"","sources":["../../../src/tree-view/TreeViewTextItem.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAsBA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,qDAAqD,CAAC;AAC7F,OAAO,EAAE,uBAAuB,EAAE,MAAM,sDAAsD,CAAC;AAC/F,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAM3C,OAAO,EAAE,eAAe,EA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BAAsB,EAChC,IAAI,EAAC,OAAO,IACR,MAAM,CAAC,WAAW,IACtB,cAAc,kBACZ,QAAQ,IACL,MAAM,CAAC,WAAW,CAAC,cAAc,aAGrC,MAAM,CAAC,IAAI,KATP,KAAK,CAUM,CACnB,CAAC;oBACJ,CAAC,CAAC,GACA,KACU,CACnB,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport type React from 'react';\n\nimport { Checkbox } from '../checkbox';\nimport { CleanIconButton } from '../clean-icon-button';\nimport { ConditionalWrap } from '../conditional-wrap';\nimport { ChevronDownIconOutline } from '../icons/generated/heroIcons/ChevronDownIconOutline';\nimport { ChevronRightIconOutline } from '../icons/generated/heroIcons/ChevronRightIconOutline';\nimport { Skeleton } from '../skeleton';\nimport { Typography } from '../typography';\nimport {\n type FlattenedTreeItem,\n type TextItemData,\n type TreeItemComponentProps,\n} from './tree-view-types';\nimport { TreeItemWrapper } from './TreeItemWrapper';\n\n/**\n * checks if any parent is checked\n * @param item - Tree item\n * @param items - Flattened tree items\n * @returns\n */\nconst parentIsCheckedRecursively = (\n item: FlattenedTreeItem<TextItemData>,\n items: FlattenedTreeItem<TextItemData>[],\n): boolean => {\n const parent = items.find((parentItem) => parentItem.id === item.parentId);\n if (parent) {\n if (parent.isSelected) {\n return true;\n }\n return parentIsCheckedRecursively(parent, items);\n }\n return false;\n};\n\n/**\n * checks if any children are checked\n * @param item - Tree item\n * @param items - Flattened tree items\n * @returns\n */\nconst childrenCheckedRecursively = (\n item: FlattenedTreeItem<TextItemData>,\n items: FlattenedTreeItem<TextItemData>[],\n): boolean => {\n const children = items.filter((childItem) => childItem.parentId === item.id);\n if (children.length === 0) {\n return false;\n }\n return children.some(\n (childItem) =>\n childItem.isSelected || childrenCheckedRecursively(childItem, items),\n );\n};\n\nexport const TreeViewTextItem = <T extends TextItemData>({\n depth,\n shouldDisableInteraction,\n shouldDisableSorting,\n isGhost,\n indentationWidth,\n isIndicator,\n isCollapsed,\n onCollapse,\n item,\n parent,\n isOver,\n isOverParent,\n setNodeRef,\n setActivatorNodeRef,\n dragHandleProps,\n style,\n trails,\n onItemsChanged,\n items,\n tabIndex,\n ref,\n ...restProps\n}: TreeItemComponentProps<T> & { ref?: React.Ref<HTMLElement> }) => {\n const isAnyParentChecked = parentIsCheckedRecursively(item, items);\n const isAnyChildChecked = childrenCheckedRecursively(item, items);\n\n const isIndeterminate =\n isAnyChildChecked === true &&\n isAnyParentChecked === false &&\n item.isSelected === false\n ? true\n : false;\n\n return (\n <TreeItemWrapper\n depth={depth}\n shouldDisableInteraction={shouldDisableInteraction}\n shouldDisableSorting={shouldDisableSorting}\n isGhost={isGhost}\n indentationWidth={indentationWidth}\n isIndicator={isIndicator}\n isCollapsed={isCollapsed}\n onCollapse={onCollapse}\n item={item}\n parent={parent}\n isOver={isOver}\n isOverParent={isOverParent}\n setNodeRef={setNodeRef}\n setActivatorNodeRef={setActivatorNodeRef}\n dragHandleProps={dragHandleProps}\n style={style}\n trails={trails}\n // oxlint-disable-next-line @typescript-eslint/no-empty-function\n onItemsChanged={() => {}}\n ref={ref}\n items={items}\n tabIndex={tabIndex}\n {...restProps}\n >\n {item.canHaveSubItems && onCollapse && (\n <button\n type=\"button\"\n className=\"ndl-tree-view-collapse-button\"\n onClick={() => onCollapse()}\n aria-label={item.isCollapsed ? 'Expand' : 'Collapse'}\n aria-expanded={item.isCollapsed ? 'false' : 'true'}\n /**\n * Tab index is set to -1 to prevent the item from being focused when the tree is navigated with tab\n * since we use the arrow keys instead\n */\n tabIndex={tabIndex}\n >\n {item.isCollapsed && <ChevronRightIconOutline className=\"ndl-icon\" />}\n {!item.isCollapsed && <ChevronDownIconOutline className=\"ndl-icon\" />}\n </button>\n )}\n {item.isSelected !== undefined && (\n <Skeleton\n onBackground=\"weak\"\n shape=\"rectangular\"\n {...item.skeletonProps}\n isLoading={item.isSkeletonLoading}\n >\n <Checkbox\n isIndeterminate={isIndeterminate}\n isChecked={item.isSelected}\n ariaLabel={item.data.text}\n htmlAttributes={{\n tabIndex,\n }}\n onChange={(event) => {\n const newItems = items.map((treeItem) => {\n if (treeItem.id === item.id) {\n return {\n ...treeItem,\n isSelected: event.target.checked,\n };\n }\n return treeItem;\n });\n\n // Uncheck parents if a child is unchecked\n if (!event.target.checked) {\n let parentId = item.parentId;\n while (parentId !== null) {\n const parent = newItems.find(\n (newItem) => newItem.id === parentId,\n );\n if (parent) {\n newItems.forEach((newItem) => {\n if (newItem.id === parent.id) {\n newItem.isSelected = false;\n }\n });\n parentId = parent.parentId;\n } else {\n parentId = null;\n }\n }\n }\n // Check children if a parent is checked\n if (item.canHaveSubItems) {\n const childIdsToUncheck = items\n .filter((childItem) => childItem.parentId === item.id)\n .map((childItem) => childItem.id);\n while (childIdsToUncheck.length > 0) {\n const childId = childIdsToUncheck.pop();\n const child = items.find(\n (childItem) => childItem.id === childId,\n );\n if (child) {\n newItems.forEach((newItem) => {\n if (newItem.id === child.id) {\n newItem.isSelected = event.target.checked;\n }\n });\n newItems\n .filter((childItem) => childItem.parentId === child.id)\n .forEach((childItem) => {\n childIdsToUncheck.push(childItem.id);\n });\n }\n }\n }\n onItemsChanged(newItems, { item, reason: 'selected' });\n }}\n aria-label={item.data.text}\n />\n </Skeleton>\n )}\n\n <Skeleton\n onBackground=\"weak\"\n shape=\"rectangular\"\n height=\"20px\"\n {...item.skeletonProps}\n isLoading={item.isSkeletonLoading}\n >\n <ConditionalWrap\n shouldWrap={item.data.onTextClick !== undefined}\n wrap={(children) => (\n <button\n type=\"button\"\n onClick={item.data.onTextClick}\n className=\"ndl-tree-view-text-clickable\"\n tabIndex={tabIndex}\n >\n {children}\n </button>\n )}\n >\n <Typography\n variant={item.canHaveSubItems ? 'subheading-small' : 'body-medium'}\n htmlAttributes={{\n style: {\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n },\n }}\n >\n {item.data.text}\n </Typography>\n </ConditionalWrap>\n </Skeleton>\n <div className=\"ndl-tree-view-actions\">\n {item.data.actions &&\n item.data.actions.map((action, index) => {\n return (\n <CleanIconButton\n key={index}\n className=\"ndl-tree-view-action\"\n size=\"small\"\n {...action.buttonProps}\n htmlAttributes={{\n tabIndex,\n ...action.buttonProps.htmlAttributes,\n }}\n >\n {action.icon}\n </CleanIconButton>\n );\n })}\n </div>\n </TreeItemWrapper>\n );\n};\n"]}
|
|
1
|
+
{"version":3,"file":"TreeViewTextItem.js","sourceRoot":"","sources":["../../../src/tree-view/TreeViewTextItem.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAsBA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,qDAAqD,CAAC;AAC7F,OAAO,EAAE,uBAAuB,EAAE,MAAM,sDAAsD,CAAC;AAC/F,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAM3C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD;;;;;GAKG;AACH,MAAM,0BAA0B,GAAG,CACjC,IAAqC,EACrC,KAAwC,EAC/B,EAAE;IACX,MAAM,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,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UM,CACnB,CAAC;oBACJ,CAAC,CAAC,GACA,KACU,CACnB,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport type React from 'react';\n\nimport { Checkbox } from '../checkbox';\nimport { CleanIconButton } from '../clean-icon-button';\nimport { ConditionalWrap } from '../conditional-wrap';\nimport { ChevronDownIconOutline } from '../icons/generated/heroIcons/ChevronDownIconOutline';\nimport { ChevronRightIconOutline } from '../icons/generated/heroIcons/ChevronRightIconOutline';\nimport { Skeleton } from '../skeleton';\nimport { Typography } from '../typography';\nimport {\n type FlattenedTreeItem,\n type TextItemData,\n type TreeItemComponentProps,\n} from './tree-view-types';\nimport { TreeItemWrapper } from './TreeItemWrapper';\n\n/**\n * checks if any parent is checked\n * @param item - Tree item\n * @param items - Flattened tree items\n * @returns\n */\nconst parentIsCheckedRecursively = (\n item: FlattenedTreeItem<TextItemData>,\n items: FlattenedTreeItem<TextItemData>[],\n): boolean => {\n const parent = items.find((parentItem) => parentItem.id === item.parentId);\n if (parent) {\n if (parent.isSelected) {\n return true;\n }\n return parentIsCheckedRecursively(parent, items);\n }\n return false;\n};\n\n/**\n * checks if any children are checked\n * @param item - Tree item\n * @param items - Flattened tree items\n * @returns\n */\nconst childrenCheckedRecursively = (\n item: FlattenedTreeItem<TextItemData>,\n items: FlattenedTreeItem<TextItemData>[],\n): boolean => {\n const children = items.filter((childItem) => childItem.parentId === item.id);\n if (children.length === 0) {\n return false;\n }\n return children.some(\n (childItem) =>\n childItem.isSelected || childrenCheckedRecursively(childItem, items),\n );\n};\n\nexport const TreeViewTextItem = <T extends TextItemData>({\n depth,\n shouldDisableInteraction,\n shouldDisableSorting,\n isGhost,\n indentationWidth,\n isIndicator,\n isCollapsed,\n onCollapse,\n item,\n parent,\n isOver,\n isOverParent,\n setNodeRef,\n setActivatorNodeRef,\n dragHandleProps,\n style,\n trails,\n onItemsChanged,\n items,\n tabIndex,\n ref,\n ...restProps\n}: TreeItemComponentProps<T> & { ref?: React.Ref<HTMLElement> }) => {\n const isAnyParentChecked = parentIsCheckedRecursively(item, items);\n const isAnyChildChecked = childrenCheckedRecursively(item, items);\n\n const isIndeterminate =\n isAnyChildChecked === true &&\n isAnyParentChecked === false &&\n item.isSelected === false\n ? true\n : false;\n\n return (\n <TreeItemWrapper\n depth={depth}\n shouldDisableInteraction={shouldDisableInteraction}\n shouldDisableSorting={shouldDisableSorting}\n isGhost={isGhost}\n indentationWidth={indentationWidth}\n isIndicator={isIndicator}\n isCollapsed={isCollapsed}\n onCollapse={onCollapse}\n item={item}\n parent={parent}\n isOver={isOver}\n isOverParent={isOverParent}\n setNodeRef={setNodeRef}\n setActivatorNodeRef={setActivatorNodeRef}\n dragHandleProps={dragHandleProps}\n style={style}\n trails={trails}\n // oxlint-disable-next-line @typescript-eslint/no-empty-function\n onItemsChanged={() => {}}\n ref={ref}\n items={items}\n tabIndex={tabIndex}\n {...restProps}\n >\n {item.canHaveSubItems && onCollapse && (\n <button\n type=\"button\"\n className=\"ndl-tree-view-collapse-button\"\n onClick={() => onCollapse()}\n aria-label={item.isCollapsed ? 'Expand' : 'Collapse'}\n aria-expanded={item.isCollapsed ? 'false' : 'true'}\n /**\n * Tab index is set to -1 to prevent the item from being focused when the tree is navigated with tab\n * since we use the arrow keys instead\n */\n tabIndex={tabIndex}\n >\n {item.isCollapsed && <ChevronRightIconOutline className=\"ndl-icon\" />}\n {!item.isCollapsed && <ChevronDownIconOutline className=\"ndl-icon\" />}\n </button>\n )}\n {item.isSelected !== undefined && (\n <Skeleton\n onBackground=\"weak\"\n shape=\"rectangular\"\n {...item.skeletonProps}\n isLoading={item.isSkeletonLoading}\n >\n <Checkbox\n isIndeterminate={isIndeterminate}\n isChecked={item.isSelected}\n ariaLabel={item.data.text}\n htmlAttributes={{\n tabIndex,\n }}\n onChange={(event) => {\n const newItems = items.map((treeItem) => {\n if (treeItem.id === item.id) {\n return {\n ...treeItem,\n isSelected: event.target.checked,\n };\n }\n return treeItem;\n });\n\n // Uncheck parents if a child is unchecked\n if (!event.target.checked) {\n let parentId = item.parentId;\n while (parentId !== null) {\n const parent = newItems.find(\n (newItem) => newItem.id === parentId,\n );\n if (parent) {\n newItems.forEach((newItem) => {\n if (newItem.id === parent.id) {\n newItem.isSelected = false;\n }\n });\n parentId = parent.parentId;\n } else {\n parentId = null;\n }\n }\n }\n // Check children if a parent is checked\n if (item.canHaveSubItems) {\n const childIdsToUncheck = items\n .filter((childItem) => childItem.parentId === item.id)\n .map((childItem) => childItem.id);\n while (childIdsToUncheck.length > 0) {\n const childId = childIdsToUncheck.pop();\n const child = items.find(\n (childItem) => childItem.id === childId,\n );\n if (child) {\n newItems.forEach((newItem) => {\n if (newItem.id === child.id) {\n newItem.isSelected = event.target.checked;\n }\n });\n newItems\n .filter((childItem) => childItem.parentId === child.id)\n .forEach((childItem) => {\n childIdsToUncheck.push(childItem.id);\n });\n }\n }\n }\n onItemsChanged(newItems, { item, reason: 'selected' });\n }}\n aria-label={item.data.text}\n />\n </Skeleton>\n )}\n\n <Skeleton\n onBackground=\"weak\"\n shape=\"rectangular\"\n height=\"20px\"\n {...item.skeletonProps}\n isLoading={item.isSkeletonLoading}\n >\n <ConditionalWrap\n shouldWrap={item.data.onTextClick !== undefined}\n wrap={(children) => (\n <button\n type=\"button\"\n onClick={item.data.onTextClick}\n className=\"ndl-tree-view-text-clickable\"\n tabIndex={tabIndex}\n >\n {children}\n </button>\n )}\n >\n <Typography\n variant={item.canHaveSubItems ? 'subheading-medium' : 'body-medium'}\n htmlAttributes={{\n style: {\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n },\n }}\n >\n {item.data.text}\n </Typography>\n </ConditionalWrap>\n </Skeleton>\n <div className=\"ndl-tree-view-actions\">\n {item.data.actions &&\n item.data.actions.map((action, index) => {\n return (\n <CleanIconButton\n key={index}\n className=\"ndl-tree-view-action\"\n size=\"small\"\n {...action.buttonProps}\n htmlAttributes={{\n tabIndex,\n ...action.buttonProps.htmlAttributes,\n }}\n >\n {action.icon}\n </CleanIconButton>\n );\n })}\n </div>\n </TreeItemWrapper>\n );\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Typography.js","sourceRoot":"","sources":["../../../src/typography/Typography.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAqBA,OAAO,UAAU,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"Typography.js","sourceRoot":"","sources":["../../../src/typography/Typography.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAqBA,OAAO,UAAU,MAAM,YAAY,CAAC;AAkBpC,MAAM,CAAC,MAAM,UAAU,GAAG,CACxB,KAAiD,EACtB,EAAE;IAC7B,MAAM,EACJ,EAAE,EACF,SAAS,GAAG,EAAE,EACd,QAAQ,EACR,OAAO,EACP,cAAc,EACd,GAAG,KAED,KAAK,EADJ,SAAS,UACV,KAAK,EARH,mEAQL,CAAQ,CAAC;IAEV,MAAM,OAAO,GAAG,UAAU,CAAC,KAAK,OAAO,EAAE,EAAE,SAAS,CAAC,CAAC;IACtD,MAAM,SAAS,GAAG,EAAE,aAAF,EAAE,cAAF,EAAE,GAAI,MAAM,CAAC;IAE/B,OAAO,CACL,KAAC,SAAS,kBAAC,SAAS,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,IAAM,SAAS,EAAM,cAAc,cACvE,QAAQ,IACC,CACb,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport { type tokens } from '@neo4j-ndl/base';\nimport classNames from 'classnames';\n\nimport { type PolymorphicCommonProps } from '../_common/types';\n\nexport type TypographyVariants = keyof typeof tokens.typography;\n\ntype TypographyProps = {\n /**\n * The typography variant to use for the text.\n *\n * `label` is deprecated: it is identical to `title-4`, which should be used\n * instead.\n */\n variant: TypographyVariants;\n /** Content displayed inside the component */\n children?: React.ReactNode;\n};\n\nexport const Typography = <T extends React.ElementType = 'span'>(\n props: PolymorphicCommonProps<T, TypographyProps>,\n): React.ReactElement | null => {\n const {\n as,\n className = '',\n children,\n variant,\n htmlAttributes,\n ref,\n ...restProps\n } = props;\n\n const classes = classNames(`n-${variant}`, className);\n const Component = as ?? 'span';\n\n return (\n <Component className={classes} ref={ref} {...restProps} {...htmlAttributes}>\n {children}\n </Component>\n );\n};\n"]}
|
|
@@ -16,7 +16,7 @@ import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
16
16
|
*/
|
|
17
17
|
import { Typography } from '../Typography';
|
|
18
18
|
const Component = () => {
|
|
19
|
-
const variant = 'title-
|
|
19
|
+
const variant = 'title-2';
|
|
20
20
|
return (_jsxs(Typography, { as: "a", htmlAttributes: { href: '/index' }, variant: variant, children: [variant, ": The quick brown fox jumps over the lazy dog"] }));
|
|
21
21
|
};
|
|
22
22
|
export default Component;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typography-anchor.story.js","sourceRoot":"","sources":["../../../../src/typography/stories/typography-anchor.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,OAAO,GAAG,SAAS,CAAC;IAE1B,OAAO,CACL,MAAC,UAAU,IAAC,EAAE,EAAC,GAAG,EAAC,cAAc,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,OAAO,EAAE,OAAO,aACpE,OAAO,qDACG,CACd,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC","sourcesContent":["/**\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n * This file is part of Neo4j.\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport { Typography } from '../Typography';\n\nconst Component = () => {\n const variant = 'title-
|
|
1
|
+
{"version":3,"file":"typography-anchor.story.js","sourceRoot":"","sources":["../../../../src/typography/stories/typography-anchor.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,OAAO,GAAG,SAAS,CAAC;IAE1B,OAAO,CACL,MAAC,UAAU,IAAC,EAAE,EAAC,GAAG,EAAC,cAAc,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,OAAO,EAAE,OAAO,aACpE,OAAO,qDACG,CACd,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC","sourcesContent":["/**\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n * This file is part of Neo4j.\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport { Typography } from '../Typography';\n\nconst Component = () => {\n const variant = 'title-2';\n\n return (\n <Typography as=\"a\" htmlAttributes={{ href: '/index' }} variant={variant}>\n {variant}: The quick brown fox jumps over the lazy dog\n </Typography>\n );\n};\n\nexport default Component;\n"]}
|
|
@@ -22,7 +22,12 @@ import { type tokens } from '@neo4j-ndl/base';
|
|
|
22
22
|
import { type PolymorphicCommonProps } from '../_common/types';
|
|
23
23
|
export type TypographyVariants = keyof typeof tokens.typography;
|
|
24
24
|
type TypographyProps = {
|
|
25
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* The typography variant to use for the text.
|
|
27
|
+
*
|
|
28
|
+
* `label` is deprecated: it is identical to `title-4`, which should be used
|
|
29
|
+
* instead.
|
|
30
|
+
*/
|
|
26
31
|
variant: TypographyVariants;
|
|
27
32
|
/** Content displayed inside the component */
|
|
28
33
|
children?: React.ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Typography.d.ts","sourceRoot":"","sources":["../../../src/typography/Typography.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAG9C,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAE/D,MAAM,MAAM,kBAAkB,GAAG,MAAM,OAAO,MAAM,CAAC,UAAU,CAAC;AAEhE,KAAK,eAAe,GAAG;IACrB
|
|
1
|
+
{"version":3,"file":"Typography.d.ts","sourceRoot":"","sources":["../../../src/typography/Typography.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAG9C,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAE/D,MAAM,MAAM,kBAAkB,GAAG,MAAM,OAAO,MAAM,CAAC,UAAU,CAAC;AAEhE,KAAK,eAAe,GAAG;IACrB;;;;;OAKG;IACH,OAAO,EAAE,kBAAkB,CAAC;IAC5B,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,MAAM,EAC7D,OAAO,sBAAsB,CAAC,CAAC,EAAE,eAAe,CAAC,KAChD,KAAK,CAAC,YAAY,GAAG,IAmBvB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neo4j-ndl/react",
|
|
3
|
-
"version": "4.21.1",
|
|
3
|
+
"version": "4.21.2-alpha.585cb7c.16.1",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"description": "React implementation of Neo4j Design System",
|
|
6
6
|
"keywords": [
|
|
@@ -404,7 +404,7 @@
|
|
|
404
404
|
"@tanstack/react-table": "8.21.3",
|
|
405
405
|
"react": ">=19.0.0",
|
|
406
406
|
"react-dom": ">=19.0.0",
|
|
407
|
-
"@neo4j-ndl/base": "^4.20.1"
|
|
407
|
+
"@neo4j-ndl/base": "^4.20.2-alpha.585cb7c.16.1"
|
|
408
408
|
},
|
|
409
409
|
"dependencies": {
|
|
410
410
|
"@dnd-kit/core": "6.3.1",
|
|
@@ -242,19 +242,19 @@ const Component = () => {
|
|
|
242
242
|
<CleanIconButton description="Search" size="small">
|
|
243
243
|
<MagnifyingGlassIconOutline />
|
|
244
244
|
</CleanIconButton>
|
|
245
|
-
<Typography variant="
|
|
245
|
+
<Typography variant="title-4"> Small</Typography>
|
|
246
246
|
</div>
|
|
247
247
|
<div className="n-flex n-flex-row n-gap-token-16 n-items-center">
|
|
248
248
|
<CleanIconButton description="Search" size="medium">
|
|
249
249
|
<MagnifyingGlassIconOutline />
|
|
250
250
|
</CleanIconButton>
|
|
251
|
-
<Typography variant="
|
|
251
|
+
<Typography variant="title-4"> Medium</Typography>
|
|
252
252
|
</div>
|
|
253
253
|
<div className="n-flex n-flex-row n-gap-token-16 n-items-center">
|
|
254
254
|
<CleanIconButton description="Search" size="large">
|
|
255
255
|
<MagnifyingGlassIconOutline />
|
|
256
256
|
</CleanIconButton>
|
|
257
|
-
<Typography variant="
|
|
257
|
+
<Typography variant="title-4"> Large</Typography>
|
|
258
258
|
</div>
|
|
259
259
|
</div>
|
|
260
260
|
);
|
|
@@ -278,13 +278,13 @@ const Component = () => {
|
|
|
278
278
|
<CleanIconButton description="Search" variant="neutral">
|
|
279
279
|
<MagnifyingGlassIconOutline />
|
|
280
280
|
</CleanIconButton>
|
|
281
|
-
<Typography variant="
|
|
281
|
+
<Typography variant="title-4">Default</Typography>
|
|
282
282
|
</div>
|
|
283
283
|
<div className="n-flex n-flex-row n-gap-token-16 n-items-center">
|
|
284
284
|
<CleanIconButton description="Search" variant="danger">
|
|
285
285
|
<MagnifyingGlassIconOutline />
|
|
286
286
|
</CleanIconButton>
|
|
287
|
-
<Typography variant="
|
|
287
|
+
<Typography variant="title-4">Danger</Typography>
|
|
288
288
|
</div>
|
|
289
289
|
</div>
|
|
290
290
|
);
|
|
@@ -36,10 +36,10 @@ import { ColorPicker } from '../ColorPicker';
|
|
|
36
36
|
|
|
37
37
|
const Component = () => {
|
|
38
38
|
const [color, setColor] = useState({
|
|
39
|
-
a: 1,
|
|
40
|
-
b: 0,
|
|
41
|
-
g: 0,
|
|
42
|
-
r: 0,
|
|
39
|
+
a: 1, // oxlint-disable-line id-length
|
|
40
|
+
b: 0, // oxlint-disable-line id-length
|
|
41
|
+
g: 0, // oxlint-disable-line id-length
|
|
42
|
+
r: 0, // oxlint-disable-line id-length
|
|
43
43
|
});
|
|
44
44
|
|
|
45
45
|
return (
|
|
@@ -62,10 +62,10 @@ import { ColorPicker } from '../ColorPicker';
|
|
|
62
62
|
|
|
63
63
|
const Component = () => {
|
|
64
64
|
const [color, setColor] = useState({
|
|
65
|
-
a: 1,
|
|
66
|
-
b: 0,
|
|
67
|
-
g: 0,
|
|
68
|
-
r: 0,
|
|
65
|
+
a: 1, // oxlint-disable-line id-length
|
|
66
|
+
b: 0, // oxlint-disable-line id-length
|
|
67
|
+
g: 0, // oxlint-disable-line id-length
|
|
68
|
+
r: 0, // oxlint-disable-line id-length
|
|
69
69
|
});
|
|
70
70
|
|
|
71
71
|
return (
|
|
@@ -74,28 +74,28 @@ const Component = () => {
|
|
|
74
74
|
onChange={(newColor) => setColor(newColor.rgb)}
|
|
75
75
|
swatches={[
|
|
76
76
|
{
|
|
77
|
-
a: 1,
|
|
78
|
-
b: 0,
|
|
79
|
-
g: 0,
|
|
80
|
-
r: 0,
|
|
77
|
+
a: 1, // oxlint-disable-line id-length
|
|
78
|
+
b: 0, // oxlint-disable-line id-length
|
|
79
|
+
g: 0, // oxlint-disable-line id-length
|
|
80
|
+
r: 0, // oxlint-disable-line id-length
|
|
81
81
|
},
|
|
82
82
|
{
|
|
83
|
-
a: 1,
|
|
84
|
-
b: 255,
|
|
85
|
-
g: 0,
|
|
86
|
-
r: 0,
|
|
83
|
+
a: 1, // oxlint-disable-line id-length
|
|
84
|
+
b: 255, // oxlint-disable-line id-length
|
|
85
|
+
g: 0, // oxlint-disable-line id-length
|
|
86
|
+
r: 0, // oxlint-disable-line id-length
|
|
87
87
|
},
|
|
88
88
|
{
|
|
89
|
-
a: 1,
|
|
90
|
-
b: 0,
|
|
91
|
-
g: 255,
|
|
92
|
-
r: 0,
|
|
89
|
+
a: 1, // oxlint-disable-line id-length
|
|
90
|
+
b: 0, // oxlint-disable-line id-length
|
|
91
|
+
g: 255, // oxlint-disable-line id-length
|
|
92
|
+
r: 0, // oxlint-disable-line id-length
|
|
93
93
|
},
|
|
94
94
|
{
|
|
95
|
-
a: 1,
|
|
96
|
-
b: 0,
|
|
97
|
-
g: 0,
|
|
98
|
-
r: 255,
|
|
95
|
+
a: 1, // oxlint-disable-line id-length
|
|
96
|
+
b: 0, // oxlint-disable-line id-length
|
|
97
|
+
g: 0, // oxlint-disable-line id-length
|
|
98
|
+
r: 255, // oxlint-disable-line id-length
|
|
99
99
|
},
|
|
100
100
|
]}
|
|
101
101
|
/>
|
|
@@ -119,10 +119,10 @@ const Component = () => {
|
|
|
119
119
|
const handleClose = () => setIsOpen(false);
|
|
120
120
|
|
|
121
121
|
const [color, setColor] = useState({
|
|
122
|
-
a: 1,
|
|
123
|
-
b: 0,
|
|
124
|
-
g: 0,
|
|
125
|
-
r: 0,
|
|
122
|
+
a: 1, // oxlint-disable-line id-length
|
|
123
|
+
b: 0, // oxlint-disable-line id-length
|
|
124
|
+
g: 0, // oxlint-disable-line id-length
|
|
125
|
+
r: 0, // oxlint-disable-line id-length
|
|
126
126
|
});
|
|
127
127
|
|
|
128
128
|
return (
|
|
@@ -190,10 +190,10 @@ import { ColorPicker } from '../ColorPicker';
|
|
|
190
190
|
|
|
191
191
|
const Component = () => {
|
|
192
192
|
const [color, setColor] = useState({
|
|
193
|
-
a: 1,
|
|
194
|
-
b: 0,
|
|
195
|
-
g: 0,
|
|
196
|
-
r: 0,
|
|
193
|
+
a: 1, // oxlint-disable-line id-length
|
|
194
|
+
b: 0, // oxlint-disable-line id-length
|
|
195
|
+
g: 0, // oxlint-disable-line id-length
|
|
196
|
+
r: 0, // oxlint-disable-line id-length
|
|
197
197
|
});
|
|
198
198
|
|
|
199
199
|
return (
|
|
@@ -689,7 +689,7 @@ export const DatePickerWithTimeZoneBothMode = () => {
|
|
|
689
689
|
padding: '16px',
|
|
690
690
|
}}
|
|
691
691
|
>
|
|
692
|
-
<Typography variant="
|
|
692
|
+
<Typography variant="title-4">Selected Values:</Typography>
|
|
693
693
|
<Typography variant="body-small">
|
|
694
694
|
<strong>Date: </strong>
|
|
695
695
|
{selectedDate?.toISOString() ?? 'None'}
|
|
@@ -157,11 +157,11 @@ import {
|
|
|
157
157
|
|
|
158
158
|
// Configuration constants
|
|
159
159
|
const CONFIG = {
|
|
160
|
-
|
|
160
|
+
ACCEPTED_EXTENSIONS: ['.txt', '.json'] as string[],
|
|
161
161
|
MAX_FILE_SIZE: 5 * 1024 * 1024, // 5MB
|
|
162
|
+
MAX_FILES: 3,
|
|
162
163
|
PROGRESS_INCREMENT: 5,
|
|
163
164
|
UPDATE_INTERVAL: 100,
|
|
164
|
-
ACCEPTED_EXTENSIONS: ['.txt', '.json'] as string[],
|
|
165
165
|
} as const;
|
|
166
166
|
|
|
167
167
|
enum UploadState {
|
|
@@ -198,9 +198,9 @@ const Component = () => {
|
|
|
198
198
|
const simulateUpload = useCallback((files: File[]) => {
|
|
199
199
|
setUploadData((prev) => ({
|
|
200
200
|
...prev,
|
|
201
|
-
state: UploadState.Uploading,
|
|
202
201
|
files,
|
|
203
202
|
progress: 0,
|
|
203
|
+
state: UploadState.Uploading,
|
|
204
204
|
}));
|
|
205
205
|
|
|
206
206
|
const interval = setInterval(() => {
|
|
@@ -244,7 +244,7 @@ const Component = () => {
|
|
|
244
244
|
(file) =>
|
|
245
245
|
`${file.file.name}: ${file.errors.map((error) => error.message).join(', ')}`,
|
|
246
246
|
);
|
|
247
|
-
setUploadData((prev) => ({ ...prev, state: UploadState.Error
|
|
247
|
+
setUploadData((prev) => ({ ...prev, errors, state: UploadState.Error }));
|
|
248
248
|
},
|
|
249
249
|
[],
|
|
250
250
|
);
|
|
@@ -253,8 +253,8 @@ const Component = () => {
|
|
|
253
253
|
console.error('Dropzone error:', error);
|
|
254
254
|
setUploadData((prev) => ({
|
|
255
255
|
...prev,
|
|
256
|
-
state: UploadState.Error,
|
|
257
256
|
errors: [error.message],
|
|
257
|
+
state: UploadState.Error,
|
|
258
258
|
}));
|
|
259
259
|
}, []);
|
|
260
260
|
|
|
@@ -296,7 +296,7 @@ const Component = () => {
|
|
|
296
296
|
{errors.map((message, index) => (
|
|
297
297
|
<Typography
|
|
298
298
|
key={index}
|
|
299
|
-
variant="
|
|
299
|
+
variant="title-4"
|
|
300
300
|
className="n-text-danger-text n-font-semibold"
|
|
301
301
|
htmlAttributes={{ role: 'alert' }}
|
|
302
302
|
>
|
|
@@ -141,19 +141,19 @@ const Component = () => {
|
|
|
141
141
|
<IconButton description="Search" size="small">
|
|
142
142
|
<MagnifyingGlassIconOutline />
|
|
143
143
|
</IconButton>
|
|
144
|
-
<Typography variant="
|
|
144
|
+
<Typography variant="title-4"> Small</Typography>
|
|
145
145
|
</div>
|
|
146
146
|
<div className="n-flex n-flex-row n-gap-token-16 n-items-center">
|
|
147
147
|
<IconButton description="Search" size="medium">
|
|
148
148
|
<MagnifyingGlassIconOutline />
|
|
149
149
|
</IconButton>
|
|
150
|
-
<Typography variant="
|
|
150
|
+
<Typography variant="title-4"> Medium</Typography>
|
|
151
151
|
</div>
|
|
152
152
|
<div className="n-flex n-flex-row n-gap-token-16 n-items-center">
|
|
153
153
|
<IconButton description="Search" size="large">
|
|
154
154
|
<MagnifyingGlassIconOutline />
|
|
155
155
|
</IconButton>
|
|
156
|
-
<Typography variant="
|
|
156
|
+
<Typography variant="title-4"> Large</Typography>
|
|
157
157
|
</div>
|
|
158
158
|
</div>
|
|
159
159
|
);
|
|
@@ -177,13 +177,13 @@ const Component = () => {
|
|
|
177
177
|
<IconButton description="Search" variant="neutral">
|
|
178
178
|
<MagnifyingGlassIconOutline />
|
|
179
179
|
</IconButton>
|
|
180
|
-
<Typography variant="
|
|
180
|
+
<Typography variant="title-4">Default</Typography>
|
|
181
181
|
</div>
|
|
182
182
|
<div className="n-flex n-flex-row n-gap-token-16 n-items-center">
|
|
183
183
|
<IconButton description="Search" variant="danger">
|
|
184
184
|
<MagnifyingGlassIconOutline />
|
|
185
185
|
</IconButton>
|
|
186
|
-
<Typography variant="
|
|
186
|
+
<Typography variant="title-4">Danger</Typography>
|
|
187
187
|
</div>
|
|
188
188
|
</div>
|
|
189
189
|
);
|
|
@@ -75,7 +75,7 @@ import { Radio, Typography } from '@neo4j-ndl/react';
|
|
|
75
75
|
const Component = () => {
|
|
76
76
|
return (
|
|
77
77
|
<Radio
|
|
78
|
-
label={<Typography variant="
|
|
78
|
+
label={<Typography variant="title-4">Custom label</Typography>}
|
|
79
79
|
ariaLabel="example aria label"
|
|
80
80
|
/>
|
|
81
81
|
);
|
|
@@ -55,19 +55,19 @@ const Component = () => {
|
|
|
55
55
|
<SelectIconButton description="Select" size="small" isOpen={false}>
|
|
56
56
|
<SelectIcon />
|
|
57
57
|
</SelectIconButton>
|
|
58
|
-
<Typography variant="
|
|
58
|
+
<Typography variant="title-4"> Small</Typography>
|
|
59
59
|
</div>
|
|
60
60
|
<div className="n-flex n-flex-row n-gap-token-16 n-items-center">
|
|
61
61
|
<SelectIconButton description="Select" size="medium" isOpen={false}>
|
|
62
62
|
<SelectIcon />
|
|
63
63
|
</SelectIconButton>
|
|
64
|
-
<Typography variant="
|
|
64
|
+
<Typography variant="title-4"> Medium</Typography>
|
|
65
65
|
</div>
|
|
66
66
|
<div className="n-flex n-flex-row n-gap-token-16 n-items-center">
|
|
67
67
|
<SelectIconButton description="Select" size="large" isOpen={false}>
|
|
68
68
|
<SelectIcon />
|
|
69
69
|
</SelectIconButton>
|
|
70
|
-
<Typography variant="
|
|
70
|
+
<Typography variant="title-4"> Large</Typography>
|
|
71
71
|
</div>
|
|
72
72
|
</div>
|
|
73
73
|
);
|
|
@@ -96,13 +96,13 @@ const Component = () => {
|
|
|
96
96
|
>
|
|
97
97
|
<SelectIcon />
|
|
98
98
|
</SelectIconButton>
|
|
99
|
-
<Typography variant="
|
|
99
|
+
<Typography variant="title-4"> Disabled</Typography>
|
|
100
100
|
</div>
|
|
101
101
|
<div className="n-flex n-flex-row n-gap-token-16 n-items-center">
|
|
102
102
|
<SelectIconButton description="Select" size="small" isOpen={true}>
|
|
103
103
|
<SelectIcon />
|
|
104
104
|
</SelectIconButton>
|
|
105
|
-
<Typography variant="
|
|
105
|
+
<Typography variant="title-4"> Active</Typography>
|
|
106
106
|
</div>
|
|
107
107
|
<div className="n-flex n-flex-row n-gap-token-16 n-items-center">
|
|
108
108
|
<SelectIconButton
|
|
@@ -114,7 +114,7 @@ const Component = () => {
|
|
|
114
114
|
>
|
|
115
115
|
<SelectIcon />
|
|
116
116
|
</SelectIconButton>
|
|
117
|
-
<Typography variant="
|
|
117
|
+
<Typography variant="title-4"> Loading</Typography>
|
|
118
118
|
</div>
|
|
119
119
|
</div>
|
|
120
120
|
);
|
|
@@ -31,23 +31,23 @@ const Component = () => {
|
|
|
31
31
|
<div className="n-flex n-gap-token-16">
|
|
32
32
|
<div className="n-flex n-flex-col n-items-center n-gap-token-8">
|
|
33
33
|
<StatusIndicator variant="unknown" />
|
|
34
|
-
<Typography variant="
|
|
34
|
+
<Typography variant="title-4">Unknown</Typography>
|
|
35
35
|
</div>
|
|
36
36
|
<div className="n-flex n-flex-col n-items-center n-gap-token-8">
|
|
37
37
|
<StatusIndicator variant="success" />
|
|
38
|
-
<Typography variant="
|
|
38
|
+
<Typography variant="title-4">Success</Typography>
|
|
39
39
|
</div>
|
|
40
40
|
<div className="n-flex n-flex-col n-items-center n-gap-token-8">
|
|
41
41
|
<StatusIndicator variant="info" />
|
|
42
|
-
<Typography variant="
|
|
42
|
+
<Typography variant="title-4">Info</Typography>
|
|
43
43
|
</div>
|
|
44
44
|
<div className="n-flex n-flex-col n-items-center n-gap-token-8">
|
|
45
45
|
<StatusIndicator variant="warning" />
|
|
46
|
-
<Typography variant="
|
|
46
|
+
<Typography variant="title-4">Warning</Typography>
|
|
47
47
|
</div>
|
|
48
48
|
<div className="n-flex n-flex-col n-items-center n-gap-token-8">
|
|
49
49
|
<StatusIndicator variant="danger" />
|
|
50
|
-
<Typography variant="
|
|
50
|
+
<Typography variant="title-4">Danger</Typography>
|
|
51
51
|
</div>
|
|
52
52
|
</div>
|
|
53
53
|
);
|