@duro-app/ui 0.51.0 → 0.52.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Icon/Icon.d.ts +1 -1
- package/dist/components/Icon/Icon.d.ts.map +1 -1
- package/dist/components/SideNav/SideNav.d.ts +32 -3
- package/dist/components/SideNav/SideNav.d.ts.map +1 -1
- package/dist/components/SideNav/SideNav.meta.d.ts.map +1 -1
- package/dist/components/SideNav/SideNav.stories.d.ts +1 -0
- package/dist/components/SideNav/SideNav.stories.d.ts.map +1 -1
- package/dist/components/SideNav/styles.css.d.ts +4 -0
- package/dist/components/SideNav/styles.css.d.ts.map +1 -1
- package/dist/index.js +1090 -1046
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/components/Icon/Icon.tsx +56 -0
- package/src/components/SideNav/SideNav.meta.ts +10 -7
- package/src/components/SideNav/SideNav.stories.tsx +63 -4
- package/src/components/SideNav/SideNav.tsx +50 -7
- package/src/components/SideNav/styles.css.ts +7 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type IconName = 'x-circle' | 'check-circle' | 'check-done' | 'clock' | 'forbidden' | 'info-circle' | 'alert-triangle' | 'shield' | 'lock' | 'key' | 'map' | 'layers' | 'repeat' | 'database' | 'shield-check' | 'route' | 'git-branch' | 'menu' | 'pin' | 'users' | 'user-plus' | 'mail' | 'file-text' | 'plug' | 'sun' | 'moon' | 'monitor' | 'contrast' | 'info-circle-filled' | 'alert-triangle-filled' | 'check-circle-filled' | 'x-circle-filled' | 'shield-filled' | 'lock-filled';
|
|
1
|
+
export type IconName = 'x-circle' | 'check-circle' | 'check-done' | 'clock' | 'forbidden' | 'info-circle' | 'alert-triangle' | 'shield' | 'lock' | 'key' | 'map' | 'layers' | 'repeat' | 'database' | 'shield-check' | 'route' | 'git-branch' | 'menu' | 'pin' | 'server' | 'hard-drive' | 'box' | 'image' | 'tag' | 'pie-chart' | 'users' | 'user-plus' | 'mail' | 'file-text' | 'plug' | 'sun' | 'moon' | 'monitor' | 'contrast' | 'info-circle-filled' | 'alert-triangle-filled' | 'check-circle-filled' | 'x-circle-filled' | 'shield-filled' | 'lock-filled';
|
|
2
2
|
interface IconProps {
|
|
3
3
|
name: IconName;
|
|
4
4
|
size?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../../src/components/Icon/Icon.tsx"],"names":[],"mappings":"AAEA,MAAM,MAAM,QAAQ,GAChB,UAAU,GACV,cAAc,GACd,YAAY,GACZ,OAAO,GACP,WAAW,GACX,aAAa,GACb,gBAAgB,GAChB,QAAQ,GACR,MAAM,GACN,KAAK,GAEL,KAAK,GACL,QAAQ,GACR,QAAQ,GACR,UAAU,GACV,cAAc,GACd,OAAO,GACP,YAAY,GACZ,MAAM,GACN,KAAK,GAEL,OAAO,GACP,WAAW,GACX,MAAM,GACN,WAAW,GACX,MAAM,GAEN,KAAK,GACL,MAAM,GACN,SAAS,GACT,UAAU,GAEV,oBAAoB,GACpB,uBAAuB,GACvB,qBAAqB,GACrB,iBAAiB,GACjB,eAAe,GACf,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../../src/components/Icon/Icon.tsx"],"names":[],"mappings":"AAEA,MAAM,MAAM,QAAQ,GAChB,UAAU,GACV,cAAc,GACd,YAAY,GACZ,OAAO,GACP,WAAW,GACX,aAAa,GACb,gBAAgB,GAChB,QAAQ,GACR,MAAM,GACN,KAAK,GAEL,KAAK,GACL,QAAQ,GACR,QAAQ,GACR,UAAU,GACV,cAAc,GACd,OAAO,GACP,YAAY,GACZ,MAAM,GACN,KAAK,GAEL,QAAQ,GACR,YAAY,GACZ,KAAK,GACL,OAAO,GACP,KAAK,GACL,WAAW,GAEX,OAAO,GACP,WAAW,GACX,MAAM,GACN,WAAW,GACX,MAAM,GAEN,KAAK,GACL,MAAM,GACN,SAAS,GACT,UAAU,GAEV,oBAAoB,GACpB,uBAAuB,GACvB,qBAAqB,GACrB,iBAAiB,GACjB,eAAe,GACf,aAAa,CAAA;AA+SjB,UAAU,SAAS;IACjB,IAAI,EAAE,QAAQ,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,wBAAgB,IAAI,CAAC,EAAC,IAAI,EAAE,IAAS,EAAC,EAAE,SAAS,2CAwBhD"}
|
|
@@ -1,4 +1,29 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* SideNav has two ways to chunk a rail, and they are NOT interchangeable.
|
|
4
|
+
*
|
|
5
|
+
* `Section` — a labelled block that is always open. This is the DEFAULT for
|
|
6
|
+
* primary navigation. A nav's job is to advertise where you can go; an
|
|
7
|
+
* always-open list keeps the whole information architecture scannable and puts
|
|
8
|
+
* every destination one click away. The uppercase label does the chunking work
|
|
9
|
+
* on its own — you get the grouping benefit without hiding anything.
|
|
10
|
+
*
|
|
11
|
+
* `Group` — the same block behind a chevron (a disclosure). Collapsing costs
|
|
12
|
+
* every destination inside it an extra click and hides it from scanning, so it
|
|
13
|
+
* has to buy something back. It does when the region is:
|
|
14
|
+
* • rare or advanced ("Advanced", "Danger zone", "Legacy") — disclose the
|
|
15
|
+
* seldom-used, never the everyday;
|
|
16
|
+
* • unbounded / data-driven (one entry per namespace, project, team) — you
|
|
17
|
+
* cannot author-flatten a list whose length you don't control;
|
|
18
|
+
* • one of many in a rail long enough (>~30 leaves) that a flat list stops
|
|
19
|
+
* reading as an overview.
|
|
20
|
+
* The healthy shape is a mix: flat Sections for the journey, one collapsed
|
|
21
|
+
* Group at the bottom.
|
|
22
|
+
*
|
|
23
|
+
* Neither is a tree. Arbitrary-depth *data* browsing (a file tree, a
|
|
24
|
+
* namespace → resource drill-down) needs `role="tree"` with roving tabindex,
|
|
25
|
+
* typeahead and aria-level — a different component, not a deeper SideNav.
|
|
26
|
+
*/
|
|
2
27
|
interface RootProps {
|
|
3
28
|
children: ReactNode;
|
|
4
29
|
value?: string;
|
|
@@ -19,9 +44,13 @@ interface SectionProps {
|
|
|
19
44
|
}
|
|
20
45
|
/**
|
|
21
46
|
* A static, non-collapsible grouping: an always-visible uppercase header with
|
|
22
|
-
* its items below. Unlike `Group` there is no chevron, toggle, or hidden state
|
|
23
|
-
*
|
|
24
|
-
*
|
|
47
|
+
* its items below. Unlike `Group` there is no chevron, toggle, or hidden state.
|
|
48
|
+
*
|
|
49
|
+
* Reach for this first — see the note at the top of this file for when a
|
|
50
|
+
* collapsible `Group` is the better call. The label is exposed as the group's
|
|
51
|
+
* accessible name, so a screen reader announces "Networking, group" on the way
|
|
52
|
+
* into its items instead of dropping the user into an undifferentiated run of
|
|
53
|
+
* thirty buttons.
|
|
25
54
|
*/
|
|
26
55
|
declare function Section({ children, label }: SectionProps): import("react/jsx-runtime").JSX.Element;
|
|
27
56
|
interface ItemProps {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SideNav.d.ts","sourceRoot":"","sources":["../../../src/components/SideNav/SideNav.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,SAAS,
|
|
1
|
+
{"version":3,"file":"SideNav.d.ts","sourceRoot":"","sources":["../../../src/components/SideNav/SideNav.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,SAAS,EAAkD,MAAM,OAAO,CAAA;AAMrF;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAIH,UAAU,SAAS;IACjB,QAAQ,EAAE,SAAS,CAAA;IACnB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;CACxC;AAED,iBAAS,IAAI,CAAC,EAAC,QAAQ,EAAE,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,aAAa,EAAC,EAAE,SAAS,2CAgEvF;AAID,UAAU,UAAU;IAClB,QAAQ,EAAE,SAAS,CAAA;IACnB,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B;AAED,iBAAS,KAAK,CAAC,EAAC,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAC,EAAE,UAAU,2CAoEtE;AAID,UAAU,YAAY;IACpB,QAAQ,EAAE,SAAS,CAAA;IACnB,KAAK,EAAE,MAAM,CAAA;CACd;AAED;;;;;;;;;GASG;AACH,iBAAS,OAAO,CAAC,EAAC,QAAQ,EAAE,KAAK,EAAC,EAAE,YAAY,2CAY/C;AAID,UAAU,SAAS;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,SAAS,CAAA;IACnB;yEACqE;IACrE,IAAI,CAAC,EAAE,SAAS,CAAA;CACjB;AAED,iBAAS,IAAI,CAAC,EAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAC,EAAE,SAAS,2CAyB/C;AAED,eAAO,MAAM,OAAO;;;;;CAKnB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SideNav.meta.d.ts","sourceRoot":"","sources":["../../../src/components/SideNav/SideNav.meta.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAA;AAEpD,eAAO,MAAM,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"SideNav.meta.d.ts","sourceRoot":"","sources":["../../../src/components/SideNav/SideNav.meta.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAA;AAEpD,eAAO,MAAM,IAAI,EAAE,aAkClB,CAAA"}
|
|
@@ -4,6 +4,7 @@ declare const meta: Meta<typeof SideNav.Root>;
|
|
|
4
4
|
export default meta;
|
|
5
5
|
type Story = StoryObj<typeof SideNav.Root>;
|
|
6
6
|
export declare const Default: Story;
|
|
7
|
+
export declare const SectionsWithOneDisclosedGroup: Story;
|
|
7
8
|
export declare const Collapsed: Story;
|
|
8
9
|
export declare const DefaultExpandedWithActiveItem: Story;
|
|
9
10
|
export declare const Interactive: Story;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SideNav.stories.d.ts","sourceRoot":"","sources":["../../../src/components/SideNav/SideNav.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,IAAI,EAAE,QAAQ,EAAC,MAAM,kBAAkB,CAAA;AAEpD,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAA;AAGjC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,OAAO,CAAC,IAAI,CAMnC,CAAA;AAED,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,OAAO,CAAC,IAAI,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"SideNav.stories.d.ts","sourceRoot":"","sources":["../../../src/components/SideNav/SideNav.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,IAAI,EAAE,QAAQ,EAAC,MAAM,kBAAkB,CAAA;AAEpD,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAA;AAGjC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,OAAO,CAAC,IAAI,CAMnC,CAAA;AAED,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,OAAO,CAAC,IAAI,CAAC,CAAA;AAK1C,eAAO,MAAM,OAAO,EAAE,KAgCrB,CAAA;AAKD,eAAO,MAAM,6BAA6B,EAAE,KAwC3C,CAAA;AAED,eAAO,MAAM,SAAS,EAAE,KAoBvB,CAAA;AAMD,eAAO,MAAM,6BAA6B,EAAE,KAgB3C,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,KAgBzB,CAAA;AAKD,eAAO,MAAM,aAAa,EAAE,KAsC3B,CAAA"}
|
|
@@ -43,6 +43,10 @@ export declare const styles: Readonly<{
|
|
|
43
43
|
readonly chevronOpen: Readonly<{
|
|
44
44
|
readonly transform: css.StyleXClassNameFor<"transform", "rotate(90deg)">;
|
|
45
45
|
}>;
|
|
46
|
+
readonly items: Readonly<{
|
|
47
|
+
readonly display: css.StyleXClassNameFor<"display", "flex">;
|
|
48
|
+
readonly flexDirection: css.StyleXClassNameFor<"flexDirection", "column">;
|
|
49
|
+
}>;
|
|
46
50
|
readonly section: Readonly<{
|
|
47
51
|
readonly display: css.StyleXClassNameFor<"display", "flex">;
|
|
48
52
|
readonly flexDirection: css.StyleXClassNameFor<"flexDirection", "column">;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.css.d.ts","sourceRoot":"","sources":["../../../src/components/SideNav/styles.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,kBAAkB,CAAA;AAMpC,eAAO,MAAM,MAAM
|
|
1
|
+
{"version":3,"file":"styles.css.d.ts","sourceRoot":"","sources":["../../../src/components/SideNav/styles.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,kBAAkB,CAAA;AAMpC,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkJjB,CAAA"}
|