@clicoh/orion-library 1.2.0-beta.24 → 1.2.0-beta.25
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/assets/css/expresivo.css +136 -11
- package/dist/components/01-atoms/CodeBlock/CodeBlock.d.ts +19 -5
- package/dist/components/01-atoms/CodeBlock/CodeBlock.d.ts.map +1 -1
- package/dist/components/01-atoms/CodeBlock/CodeBlock.jsx +41 -9
- package/dist/components/01-atoms/CodeBlock/CodeBlock.jsx.map +1 -1
- package/dist/components/02-molecules/Table/Table.d.ts +28 -1
- package/dist/components/02-molecules/Table/Table.d.ts.map +1 -1
- package/dist/components/02-molecules/Table/Table.jsx +119 -64
- package/dist/components/02-molecules/Table/Table.jsx.map +1 -1
- package/dist/components/02-molecules/Table/index.d.ts +1 -1
- package/dist/components/02-molecules/Table/index.d.ts.map +1 -1
- package/dist/components/04-templates/DashboardTemplate/DashboardTemplate.d.ts +3 -1
- package/dist/components/04-templates/DashboardTemplate/DashboardTemplate.d.ts.map +1 -1
- package/dist/components/04-templates/DashboardTemplate/DashboardTemplate.jsx +7 -3
- package/dist/components/04-templates/DashboardTemplate/DashboardTemplate.jsx.map +1 -1
- package/dist/components/04-templates/LoginTemplate/LoginForm.d.ts +5 -2
- package/dist/components/04-templates/LoginTemplate/LoginForm.d.ts.map +1 -1
- package/dist/components/04-templates/LoginTemplate/LoginForm.jsx +3 -2
- package/dist/components/04-templates/LoginTemplate/LoginForm.jsx.map +1 -1
- package/expresivo/ExpCollapseToggle/ExpCollapseToggle.d.ts +6 -2
- package/expresivo/ExpCollapseToggle/ExpCollapseToggle.d.ts.map +1 -1
- package/expresivo/ExpCollapseToggle/ExpCollapseToggle.jsx +5 -3
- package/expresivo/ExpCollapseToggle/ExpCollapseToggle.jsx.map +1 -1
- package/expresivo/ExpLadder/ExpLadder.d.ts +2 -1
- package/expresivo/ExpLadder/ExpLadder.d.ts.map +1 -1
- package/expresivo/ExpLadder/ExpLadder.jsx +7 -4
- package/expresivo/ExpLadder/ExpLadder.jsx.map +1 -1
- package/expresivo/ExpMascot/ExpMascot.d.ts +6 -2
- package/expresivo/ExpMascot/ExpMascot.d.ts.map +1 -1
- package/expresivo/ExpMascot/ExpMascot.jsx +6 -3
- package/expresivo/ExpMascot/ExpMascot.jsx.map +1 -1
- package/expresivo/ExpPageHero/ExpPageHero.d.ts +21 -5
- package/expresivo/ExpPageHero/ExpPageHero.d.ts.map +1 -1
- package/expresivo/ExpPageHero/ExpPageHero.jsx +28 -8
- package/expresivo/ExpPageHero/ExpPageHero.jsx.map +1 -1
- package/expresivo/ExpPageHero/index.d.ts +1 -1
- package/expresivo/ExpPageHero/index.d.ts.map +1 -1
- package/expresivo/ExpPillButton/ExpPillButton.d.ts +8 -4
- package/expresivo/ExpPillButton/ExpPillButton.d.ts.map +1 -1
- package/expresivo/ExpPillButton/ExpPillButton.jsx +42 -12
- package/expresivo/ExpPillButton/ExpPillButton.jsx.map +1 -1
- package/expresivo/ExpPillButton/index.d.ts +1 -1
- package/expresivo/ExpPillButton/index.d.ts.map +1 -1
- package/expresivo/ExpTabs/ExpTabs.d.ts +52 -0
- package/expresivo/ExpTabs/ExpTabs.d.ts.map +1 -0
- package/expresivo/ExpTabs/ExpTabs.jsx +105 -0
- package/expresivo/ExpTabs/ExpTabs.jsx.map +1 -0
- package/expresivo/ExpTabs/index.d.ts +3 -0
- package/expresivo/ExpTabs/index.d.ts.map +1 -0
- package/expresivo/ExpTabs/index.js +2 -0
- package/expresivo/ExpTabs/index.js.map +1 -0
- package/expresivo/index.d.ts +1 -0
- package/expresivo/index.d.ts.map +1 -1
- package/expresivo/index.js +1 -0
- package/expresivo/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -6,6 +6,8 @@ export type ExpMascotProps = {
|
|
|
6
6
|
/** Width and height on screen, in pixels. */
|
|
7
7
|
size?: number;
|
|
8
8
|
motion?: ExpMascotMotion;
|
|
9
|
+
/** The light disc behind Bugi in dark mode. Off where an edge would cut it. */
|
|
10
|
+
backdrop?: boolean;
|
|
9
11
|
} & Omit<HTMLAttributes<HTMLSpanElement>, 'children'>;
|
|
10
12
|
/**
|
|
11
13
|
* One of the official clicOH mascots, drawn from its file as is: never
|
|
@@ -19,7 +21,8 @@ export type ExpMascotProps = {
|
|
|
19
21
|
* states, 80px on small screens, 48–64px inside a message or a toast.
|
|
20
22
|
*
|
|
21
23
|
* In dark mode Bugi sits on a light disc so it reads on the dark background;
|
|
22
|
-
* Oculus and Fixi need none.
|
|
24
|
+
* Oculus and Fixi need none. `backdrop={false}` drops the disc where an edge
|
|
25
|
+
* would cut it, such as a mascot peeking from behind something.
|
|
23
26
|
*
|
|
24
27
|
* Renders nothing outside an `ExpScope`, or when the scope hides mascots.
|
|
25
28
|
*
|
|
@@ -35,8 +38,9 @@ export type ExpMascotProps = {
|
|
|
35
38
|
* @param {ExpMascotName} props.name - Mascot and pose, as in `oculus-01-feliz`.
|
|
36
39
|
* @param {number} [props.size=112] - Width and height on screen, in pixels.
|
|
37
40
|
* @param {'still' | 'float' | 'hang'} [props.motion='still'] - `float` bobs up and down; `hang` hangs it from a thread and swings it. Both stop with reduced motion.
|
|
41
|
+
* @param {boolean} [props.backdrop=true] - Light disc behind Bugi in dark mode.
|
|
38
42
|
*
|
|
39
43
|
* @returns {ReactNode} The mascot, or `null` outside an `ExpScope`.
|
|
40
44
|
*/
|
|
41
|
-
export declare function ExpMascot({ name, size, motion, ...restProps }: ExpMascotProps): ReactNode;
|
|
45
|
+
export declare function ExpMascot({ name, size, motion, backdrop, ...restProps }: ExpMascotProps): ReactNode;
|
|
42
46
|
//# sourceMappingURL=ExpMascot.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpMascot.d.ts","sourceRoot":"","sources":["../../src/expresivo/ExpMascot/ExpMascot.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvD,OAAO,EAAE,KAAK,aAAa,EAAiB,MAAM,WAAW,CAAC;AAE9D,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,CAAC;AAEzD,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,aAAa,CAAC;IACpB,6CAA6C;IAC7C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"ExpMascot.d.ts","sourceRoot":"","sources":["../../src/expresivo/ExpMascot/ExpMascot.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvD,OAAO,EAAE,KAAK,aAAa,EAAiB,MAAM,WAAW,CAAC;AAE9D,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,CAAC;AAEzD,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,aAAa,CAAC;IACpB,6CAA6C;IAC7C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,+EAA+E;IAC/E,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,GAAG,IAAI,CAAC,cAAc,CAAC,eAAe,CAAC,EAAE,UAAU,CAAC,CAAC;AAEtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,SAAS,CAAC,EACxB,IAAI,EACJ,IAAU,EACV,MAAgB,EAChB,QAAe,EACf,GAAG,SAAS,EACb,EAAE,cAAc,GAAG,SAAS,CAmC5B"}
|
|
@@ -14,7 +14,8 @@ import { mascotCatalog } from './catalog';
|
|
|
14
14
|
* states, 80px on small screens, 48–64px inside a message or a toast.
|
|
15
15
|
*
|
|
16
16
|
* In dark mode Bugi sits on a light disc so it reads on the dark background;
|
|
17
|
-
* Oculus and Fixi need none.
|
|
17
|
+
* Oculus and Fixi need none. `backdrop={false}` drops the disc where an edge
|
|
18
|
+
* would cut it, such as a mascot peeking from behind something.
|
|
18
19
|
*
|
|
19
20
|
* Renders nothing outside an `ExpScope`, or when the scope hides mascots.
|
|
20
21
|
*
|
|
@@ -30,17 +31,19 @@ import { mascotCatalog } from './catalog';
|
|
|
30
31
|
* @param {ExpMascotName} props.name - Mascot and pose, as in `oculus-01-feliz`.
|
|
31
32
|
* @param {number} [props.size=112] - Width and height on screen, in pixels.
|
|
32
33
|
* @param {'still' | 'float' | 'hang'} [props.motion='still'] - `float` bobs up and down; `hang` hangs it from a thread and swings it. Both stop with reduced motion.
|
|
34
|
+
* @param {boolean} [props.backdrop=true] - Light disc behind Bugi in dark mode.
|
|
33
35
|
*
|
|
34
36
|
* @returns {ReactNode} The mascot, or `null` outside an `ExpScope`.
|
|
35
37
|
*/
|
|
36
|
-
export function ExpMascot({ name, size = 112, motion = 'still', ...restProps }) {
|
|
38
|
+
export function ExpMascot({ name, size = 112, motion = 'still', backdrop = true, ...restProps }) {
|
|
37
39
|
const options = useExpScopeOptions();
|
|
38
40
|
if (!options || options.mascots === 'hidden')
|
|
39
41
|
return null;
|
|
40
42
|
return (<span {...restProps} aria-hidden="true" className={clsx('inline-flex shrink-0 flex-col items-center', motion === 'float' && 'exp-float', motion === 'hang' && 'exp-hang', restProps.className)}>
|
|
41
43
|
{motion === 'hang' && (<span className="bg-lavender-1 dark:bg-lavender-dark-1 h-3.5 w-[1.5px]"/>)}
|
|
42
44
|
{/* eslint-disable-next-line @next/next/no-img-element -- fixed-size package asset: `next/image` would lazy-load it */}
|
|
43
|
-
<img src={mascotCatalog[name].src} alt="" width={size} height={size} draggable={false} className={clsx('block object-contain',
|
|
45
|
+
<img src={mascotCatalog[name].src} alt="" width={size} height={size} draggable={false} className={clsx('block object-contain', backdrop &&
|
|
46
|
+
name.startsWith('bugi-') &&
|
|
44
47
|
'dark:bg-gray-6 dark:rounded-full dark:p-[8%]')}/>
|
|
45
48
|
</span>);
|
|
46
49
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpMascot.jsx","sourceRoot":"","sources":["../../src/expresivo/ExpMascot/ExpMascot.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAsB,aAAa,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"ExpMascot.jsx","sourceRoot":"","sources":["../../src/expresivo/ExpMascot/ExpMascot.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAsB,aAAa,EAAE,MAAM,WAAW,CAAC;AAa9D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,MAAM,UAAU,SAAS,CAAC,EACxB,IAAI,EACJ,IAAI,GAAG,GAAG,EACV,MAAM,GAAG,OAAO,EAChB,QAAQ,GAAG,IAAI,EACf,GAAG,SAAS,EACG;IACf,MAAM,OAAO,GAAG,kBAAkB,EAAE,CAAC;IAErC,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,OAAO,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC;IAE1D,OAAO,CACL,CAAC,IAAI,CACH,IAAI,SAAS,CAAC,CACd,WAAW,CAAC,MAAM,CAClB,SAAS,CAAC,CAAC,IAAI,CACb,4CAA4C,EAC5C,MAAM,KAAK,OAAO,IAAI,WAAW,EACjC,MAAM,KAAK,MAAM,IAAI,UAAU,EAC/B,SAAS,CAAC,SAAS,CACpB,CAAC,CAEF;MAAA,CAAC,MAAM,KAAK,MAAM,IAAI,CACpB,CAAC,IAAI,CAAC,SAAS,CAAC,uDAAuD,EAAG,CAC3E,CACD;MAAA,CAAC,qHAAqH,CACtH;MAAA,CAAC,GAAG,CACF,GAAG,CAAC,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAC7B,GAAG,CAAC,EAAE,CACN,KAAK,CAAC,CAAC,IAAI,CAAC,CACZ,MAAM,CAAC,CAAC,IAAI,CAAC,CACb,SAAS,CAAC,CAAC,KAAK,CAAC,CACjB,SAAS,CAAC,CAAC,IAAI,CACb,sBAAsB,EACtB,QAAQ;YACN,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;YACxB,8CAA8C,CACjD,CAAC,EAEN;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC"}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { type HTMLAttributes, type ReactNode } from 'react';
|
|
2
2
|
import type { ExpMascotName } from '../ExpMascot/catalog';
|
|
3
3
|
export type ExpPageHeroLevel = 'h3' | 'h4' | 'h5';
|
|
4
|
+
export type ExpPageHeroNarrowLayout = 'row' | 'band' | 'framed';
|
|
4
5
|
export type ExpPageHeroBubble = {
|
|
5
6
|
title?: ReactNode;
|
|
6
7
|
text?: ReactNode;
|
|
7
8
|
badge?: ReactNode;
|
|
9
|
+
/** Sets the title larger, in the display font, as `ExpBubble` does. */
|
|
10
|
+
display?: boolean;
|
|
8
11
|
};
|
|
9
12
|
export type ExpPageHeroCollapse = {
|
|
10
13
|
collapsed: boolean;
|
|
@@ -26,6 +29,13 @@ export type ExpPageHeroProps = {
|
|
|
26
29
|
mascot?: ExpMascotName;
|
|
27
30
|
bubble?: ExpPageHeroBubble;
|
|
28
31
|
collapse?: ExpPageHeroCollapse;
|
|
32
|
+
/**
|
|
33
|
+
* How it renders below `lg`: a plain title row with `children` (`row`), the band with only the title and
|
|
34
|
+
* `actions` (`band`), or the band around the title, `children` and `actions` (`framed`).
|
|
35
|
+
*/
|
|
36
|
+
narrowLayout?: ExpPageHeroNarrowLayout;
|
|
37
|
+
/** Mascot peeking over the top right edge of the band, below `lg` and only with `band` or `framed`. Decorative. */
|
|
38
|
+
peek?: ExpMascotName;
|
|
29
39
|
} & Omit<HTMLAttributes<HTMLDivElement>, 'title' | 'children'>;
|
|
30
40
|
/**
|
|
31
41
|
* Page header for the top of a screen, meant for the `heading` slot of
|
|
@@ -34,9 +44,13 @@ export type ExpPageHeroProps = {
|
|
|
34
44
|
*
|
|
35
45
|
* On wide screens it draws a band with a dotted lavender background. With
|
|
36
46
|
* `collapse`, a corner button tucks it down to the title, and the mascot hangs
|
|
37
|
-
* from a thread instead; the consumer keeps the state. On small screens it
|
|
38
|
-
*
|
|
39
|
-
* `
|
|
47
|
+
* from a thread instead; the consumer keeps the state. On small screens it
|
|
48
|
+
* drops the eyebrow, description, mascot and bubble, and `collapse` has no
|
|
49
|
+
* effect. With `narrowLayout="row"` (default) it is a plain title row and the
|
|
50
|
+
* children still show; with `narrowLayout="band"` it keeps the band around the
|
|
51
|
+
* title and the actions, and hides the children too; with `"framed"` the band
|
|
52
|
+
* holds the title, the children and the actions. In both, `peek` shows the top
|
|
53
|
+
* of a mascot over the band's top right edge, as if hiding behind it.
|
|
40
54
|
*
|
|
41
55
|
* Outside an `ExpScope` it renders the core title row of `DashboardTemplate`:
|
|
42
56
|
* title, adornment, description, children and actions.
|
|
@@ -73,10 +87,12 @@ export type ExpPageHeroProps = {
|
|
|
73
87
|
* @param {ReactNode} [props.children] - Content under the description, such as stat chips; hidden while collapsed.
|
|
74
88
|
* @param {ReactNode} [props.actions] - Content on the right, such as buttons; it moves under the title on small screens.
|
|
75
89
|
* @param {ExpMascotName} [props.mascot] - Mascot on the right, 104px; 56px and hanging while collapsed.
|
|
76
|
-
* @param {ExpPageHeroBubble} [props.bubble] - Speech bubble next to the mascot: `title`, `text` and `
|
|
90
|
+
* @param {ExpPageHeroBubble} [props.bubble] - Speech bubble next to the mascot: `title`, `text`, `badge` and `display` (larger title in the display font).
|
|
77
91
|
* @param {ExpPageHeroCollapse} [props.collapse] - Makes the header collapsible: `collapsed`, `onToggle`, `expandLabel` and `collapseLabel`.
|
|
92
|
+
* @param {'row' | 'band' | 'framed'} [props.narrowLayout='row'] - Below `lg`: a plain title row with the children, the band with only the title and the actions, or the band around all three.
|
|
93
|
+
* @param {ExpMascotName} [props.peek] - Mascot whose top peeks over the band's top right edge, below `lg` and only with `band` or `framed`.
|
|
78
94
|
*
|
|
79
95
|
* @returns {ReactNode} The page header.
|
|
80
96
|
*/
|
|
81
|
-
export declare function ExpPageHero({ title, eyebrow, headingLevel, titleAdornment, description, children, actions, mascot, bubble, collapse, ...restProps }: ExpPageHeroProps): ReactNode;
|
|
97
|
+
export declare function ExpPageHero({ title, eyebrow, headingLevel, titleAdornment, description, children, actions, mascot, bubble, collapse, narrowLayout, peek, ...restProps }: ExpPageHeroProps): ReactNode;
|
|
82
98
|
//# sourceMappingURL=ExpPageHero.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpPageHero.d.ts","sourceRoot":"","sources":["../../src/expresivo/ExpPageHero/ExpPageHero.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,SAAS,EAAS,MAAM,OAAO,CAAC;AAKnE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAG1D,MAAM,MAAM,gBAAgB,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAElD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,gEAAgE;IAChE,WAAW,EAAE,MAAM,CAAC;IACpB,iEAAiE;IACjE,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,EAAE,SAAS,CAAC;IACj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pB,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAChC,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,wEAAwE;IACxE,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,QAAQ,CAAC,EAAE,mBAAmB,CAAC;IAC/B;;;OAGG;IACH,YAAY,CAAC,EAAE,uBAAuB,CAAC;IACvC,mHAAmH;IACnH,IAAI,CAAC,EAAE,aAAa,CAAC;CACtB,GAAG,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC,CAAC;AAQ/D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AACH,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,OAAO,EACP,YAAmB,EACnB,cAAc,EACd,WAAW,EACX,QAAQ,EACR,OAAO,EACP,MAAM,EACN,MAAM,EACN,QAAQ,EACR,YAAoB,EACpB,IAAI,EACJ,GAAG,SAAS,EACb,EAAE,gBAAgB,GAAG,SAAS,CAmJ9B"}
|
|
@@ -6,6 +6,11 @@ import { ExpBubble } from '../ExpBubble/ExpBubble';
|
|
|
6
6
|
import { ExpCollapseToggle } from '../ExpCollapseToggle/ExpCollapseToggle';
|
|
7
7
|
import { ExpMascot } from '../ExpMascot/ExpMascot';
|
|
8
8
|
import { useExpScopeOptions } from '../ExpScope/ExpScope';
|
|
9
|
+
/** Poses whose face sits lower in the drawing show more of it over the edge, so the eyes clear it. */
|
|
10
|
+
const peekHeight = {
|
|
11
|
+
'oculus-02-investigando': 'h-12',
|
|
12
|
+
'bugi-02-investigando': 'h-12',
|
|
13
|
+
};
|
|
9
14
|
/**
|
|
10
15
|
* Page header for the top of a screen, meant for the `heading` slot of
|
|
11
16
|
* `DashboardTemplate`: an eyebrow, the title, a description, optional content
|
|
@@ -13,9 +18,13 @@ import { useExpScopeOptions } from '../ExpScope/ExpScope';
|
|
|
13
18
|
*
|
|
14
19
|
* On wide screens it draws a band with a dotted lavender background. With
|
|
15
20
|
* `collapse`, a corner button tucks it down to the title, and the mascot hangs
|
|
16
|
-
* from a thread instead; the consumer keeps the state. On small screens it
|
|
17
|
-
*
|
|
18
|
-
* `
|
|
21
|
+
* from a thread instead; the consumer keeps the state. On small screens it
|
|
22
|
+
* drops the eyebrow, description, mascot and bubble, and `collapse` has no
|
|
23
|
+
* effect. With `narrowLayout="row"` (default) it is a plain title row and the
|
|
24
|
+
* children still show; with `narrowLayout="band"` it keeps the band around the
|
|
25
|
+
* title and the actions, and hides the children too; with `"framed"` the band
|
|
26
|
+
* holds the title, the children and the actions. In both, `peek` shows the top
|
|
27
|
+
* of a mascot over the band's top right edge, as if hiding behind it.
|
|
19
28
|
*
|
|
20
29
|
* Outside an `ExpScope` it renders the core title row of `DashboardTemplate`:
|
|
21
30
|
* title, adornment, description, children and actions.
|
|
@@ -52,17 +61,21 @@ import { useExpScopeOptions } from '../ExpScope/ExpScope';
|
|
|
52
61
|
* @param {ReactNode} [props.children] - Content under the description, such as stat chips; hidden while collapsed.
|
|
53
62
|
* @param {ReactNode} [props.actions] - Content on the right, such as buttons; it moves under the title on small screens.
|
|
54
63
|
* @param {ExpMascotName} [props.mascot] - Mascot on the right, 104px; 56px and hanging while collapsed.
|
|
55
|
-
* @param {ExpPageHeroBubble} [props.bubble] - Speech bubble next to the mascot: `title`, `text` and `
|
|
64
|
+
* @param {ExpPageHeroBubble} [props.bubble] - Speech bubble next to the mascot: `title`, `text`, `badge` and `display` (larger title in the display font).
|
|
56
65
|
* @param {ExpPageHeroCollapse} [props.collapse] - Makes the header collapsible: `collapsed`, `onToggle`, `expandLabel` and `collapseLabel`.
|
|
66
|
+
* @param {'row' | 'band' | 'framed'} [props.narrowLayout='row'] - Below `lg`: a plain title row with the children, the band with only the title and the actions, or the band around all three.
|
|
67
|
+
* @param {ExpMascotName} [props.peek] - Mascot whose top peeks over the band's top right edge, below `lg` and only with `band` or `framed`.
|
|
57
68
|
*
|
|
58
69
|
* @returns {ReactNode} The page header.
|
|
59
70
|
*/
|
|
60
|
-
export function ExpPageHero({ title, eyebrow, headingLevel = 'h3', titleAdornment, description, children, actions, mascot, bubble, collapse, ...restProps }) {
|
|
71
|
+
export function ExpPageHero({ title, eyebrow, headingLevel = 'h3', titleAdornment, description, children, actions, mascot, bubble, collapse, narrowLayout = 'row', peek, ...restProps }) {
|
|
61
72
|
const options = useExpScopeOptions();
|
|
62
73
|
const generatedId = useId();
|
|
63
74
|
const id = restProps.id ?? generatedId;
|
|
64
75
|
const collapsed = !!collapse?.collapsed;
|
|
65
76
|
const hasAside = !!mascot || !!bubble;
|
|
77
|
+
const band = narrowLayout === 'band';
|
|
78
|
+
const framed = narrowLayout === 'framed';
|
|
66
79
|
const titleRow = (<div className="flex min-w-0 flex-wrap items-center gap-x-3 gap-y-1">
|
|
67
80
|
<Heading level={headingLevel}>{title}</Heading>
|
|
68
81
|
{titleAdornment}
|
|
@@ -79,7 +92,9 @@ export function ExpPageHero({ title, eyebrow, headingLevel = 'h3', titleAdornmen
|
|
|
79
92
|
{actions}
|
|
80
93
|
</div>);
|
|
81
94
|
}
|
|
82
|
-
return (<div {...restProps} id={id} data-state={collapsed ? 'collapsed' : 'expanded'} className={clsx('exp-hero relative flex
|
|
95
|
+
return (<div {...restProps} id={id} data-state={collapsed ? 'collapsed' : 'expanded'} data-narrow={narrowLayout} className={clsx('exp-hero relative flex gap-3 sm:flex-row sm:items-center sm:justify-between lg:gap-6', band
|
|
96
|
+
? 'flex-row flex-wrap items-center justify-between px-4 py-3 lg:flex-nowrap'
|
|
97
|
+
: 'flex-col items-start', framed && 'px-4 py-4', collapsed
|
|
83
98
|
? 'lg:min-h-[72px] lg:py-3.5 lg:pr-30 lg:pl-6'
|
|
84
99
|
: 'lg:px-8 lg:py-6', !collapsed && !!collapse && !hasAside && 'lg:pr-20', restProps.className)}>
|
|
85
100
|
<div className="flex min-w-0 flex-col items-start gap-1 lg:flex-[1_1_420px]">
|
|
@@ -91,17 +106,22 @@ export function ExpPageHero({ title, eyebrow, headingLevel = 'h3', titleAdornmen
|
|
|
91
106
|
{!!description && (<div className={clsx('text-gray-1 dark:text-gray-2 hidden max-w-[680px] text-sm leading-[22px] text-pretty', !collapsed && 'lg:block')}>
|
|
92
107
|
{description}
|
|
93
108
|
</div>)}
|
|
94
|
-
{!!children && (<div className={clsx('mt-2 w-full', collapsed && 'lg:hidden')}>
|
|
109
|
+
{!!children && (<div className={clsx('mt-2 w-full', band && 'hidden', band && !collapsed && 'lg:block', !band && collapsed && 'lg:hidden')}>
|
|
95
110
|
{children}
|
|
96
111
|
</div>)}
|
|
97
112
|
</div>
|
|
98
113
|
{actions}
|
|
99
114
|
{!!hasAside && (<div className={clsx('hidden shrink-0 items-center gap-4', !collapsed && 'lg:flex', !!collapse && 'lg:mr-7')}>
|
|
100
|
-
{!!bubble && (<ExpBubble tail="right" title={bubble.title} badge={bubble.badge}>
|
|
115
|
+
{!!bubble && (<ExpBubble tail="right" title={bubble.title} badge={bubble.badge} display={!!bubble.display}>
|
|
101
116
|
{bubble.text}
|
|
102
117
|
</ExpBubble>)}
|
|
103
118
|
{!!mascot && <ExpMascot name={mascot} size={104}/>}
|
|
104
119
|
</div>)}
|
|
120
|
+
{!!(band || framed) && !!peek && (<span aria-hidden="true" className={clsx('pointer-events-none absolute right-5 bottom-full mb-px flex w-16 justify-center overflow-hidden lg:hidden', peekHeight[peek] ?? 'h-10')}>
|
|
121
|
+
<span className="shrink-0">
|
|
122
|
+
<ExpMascot name={peek} size={64} motion="still" backdrop={false}/>
|
|
123
|
+
</span>
|
|
124
|
+
</span>)}
|
|
105
125
|
{!!collapsed && !!mascot && (<span className="absolute top-0 right-18 hidden lg:block">
|
|
106
126
|
<ExpMascot name={mascot} size={56} motion="hang"/>
|
|
107
127
|
</span>)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpPageHero.jsx","sourceRoot":"","sources":["../../src/expresivo/ExpPageHero/ExpPageHero.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAuC,KAAK,EAAE,MAAM,OAAO,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAC3E,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"ExpPageHero.jsx","sourceRoot":"","sources":["../../src/expresivo/ExpPageHero/ExpPageHero.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAuC,KAAK,EAAE,MAAM,OAAO,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAC3E,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AA4C1D,sGAAsG;AACtG,MAAM,UAAU,GAA2C;IACzD,wBAAwB,EAAE,MAAM;IAChC,sBAAsB,EAAE,MAAM;CAC/B,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AACH,MAAM,UAAU,WAAW,CAAC,EAC1B,KAAK,EACL,OAAO,EACP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,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,EAClE;UAAA,EAAE,IAAI,CACR;QAAA,EAAE,IAAI,CAAC,CACR,CACD;MAAA,CAAC,CAAC,CAAC,SAAS,IAAI,CAAC,CAAC,MAAM,IAAI,CAC1B,CAAC,IAAI,CAAC,SAAS,CAAC,yCAAyC,CACvD;UAAA,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,EAClD;QAAA,EAAE,IAAI,CAAC,CACR,CACD;MAAA,CAAC,CAAC,CAAC,QAAQ,IAAI,CACb,CAAC,GAAG,CAAC,SAAS,CAAC,wCAAwC,CACrD;UAAA,CAAC,iBAAiB,CAChB,SAAS,CAAC,CAAC,SAAS,CAAC,CACrB,QAAQ,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAC5B,WAAW,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,CAClC,aAAa,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,CACtC,aAAa,CAAC,CAAC,EAAE,CAAC,EAEtB;QAAA,EAAE,GAAG,CAAC,CACP,CACH;IAAA,EAAE,GAAG,CAAC,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { ExpPageHero } from './ExpPageHero';
|
|
2
|
-
export type { ExpPageHeroBubble, ExpPageHeroCollapse, ExpPageHeroLevel, ExpPageHeroProps, } from './ExpPageHero';
|
|
2
|
+
export type { ExpPageHeroBubble, ExpPageHeroCollapse, ExpPageHeroLevel, ExpPageHeroNarrowLayout, ExpPageHeroProps, } from './ExpPageHero';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/expresivo/ExpPageHero/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EACV,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/expresivo/ExpPageHero/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EACV,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,EAChB,uBAAuB,EACvB,gBAAgB,GACjB,MAAM,eAAe,CAAC"}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import type { ButtonHTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
export type ExpPillButtonTone = 'brand' | 'soft';
|
|
3
|
-
export type ExpPillButtonIcon = 'lens' | 'sync' | 'enter' | 'none';
|
|
3
|
+
export type ExpPillButtonIcon = 'lens' | 'sync' | 'enter' | 'add' | 'none';
|
|
4
|
+
export type ExpPillButtonSize = 'md' | 'sm';
|
|
4
5
|
export type ExpPillButtonProps = {
|
|
5
6
|
tone?: ExpPillButtonTone;
|
|
6
7
|
icon?: ExpPillButtonIcon;
|
|
8
|
+
/** `md` is 44px tall, like the core `Button`; `sm` is 32px, for a dense header or row. */
|
|
9
|
+
size?: ExpPillButtonSize;
|
|
7
10
|
/** Blocks the button and animates its glyph while the action runs. */
|
|
8
11
|
busy?: boolean;
|
|
9
12
|
/** Label shown while `busy`. Defaults to `children`. */
|
|
@@ -15,7 +18,7 @@ export type ExpPillButtonProps = {
|
|
|
15
18
|
} & ButtonHTMLAttributes<HTMLButtonElement>;
|
|
16
19
|
/**
|
|
17
20
|
* Light pill-shaped call to action, the same 44px height as the core
|
|
18
|
-
* `Button
|
|
21
|
+
* `Button` (32px with `size="sm"`). `brand` is a filled lavender pill that turns into the clicOH
|
|
19
22
|
* gradient on hover, with its glyph in a white disc; `soft` is a tinted pill
|
|
20
23
|
* for secondary actions, such as a button inside a field.
|
|
21
24
|
*
|
|
@@ -33,7 +36,8 @@ export type ExpPillButtonProps = {
|
|
|
33
36
|
*
|
|
34
37
|
* @param {Object} props - The properties of the ExpPillButton component.
|
|
35
38
|
* @param {'brand' | 'soft'} [props.tone='brand'] - Filled lavender or tinted.
|
|
36
|
-
* @param {'lens' | 'sync' | 'enter' | 'none'} [props.icon='lens'] - Glyph before the label.
|
|
39
|
+
* @param {'lens' | 'sync' | 'enter' | 'add' | 'none'} [props.icon='lens'] - Glyph before the label; `add` is a plus, for an action that creates something.
|
|
40
|
+
* @param {'md' | 'sm'} [props.size='md'] - 44px tall, or 32px with a smaller label and glyph; outside an `ExpScope` it maps to the core `Button` `md` or `sm`.
|
|
37
41
|
* @param {boolean} [props.busy=false] - Blocks the button and animates its glyph.
|
|
38
42
|
* @param {string} [props.busyLabel] - Label shown while `busy`.
|
|
39
43
|
* @param {boolean} [props.block=false] - Takes the full width of its container.
|
|
@@ -43,5 +47,5 @@ export type ExpPillButtonProps = {
|
|
|
43
47
|
*
|
|
44
48
|
* @returns {ReactNode} The rendered pill, or a core `Button` outside an `ExpScope`.
|
|
45
49
|
*/
|
|
46
|
-
export declare function ExpPillButton({ tone, icon, busy, busyLabel, block, flush, disabled, children, ...restProps }: ExpPillButtonProps): ReactNode;
|
|
50
|
+
export declare function ExpPillButton({ tone, icon, size, busy, busyLabel, block, flush, disabled, children, ...restProps }: ExpPillButtonProps): ReactNode;
|
|
47
51
|
//# sourceMappingURL=ExpPillButton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpPillButton.d.ts","sourceRoot":"","sources":["../../src/expresivo/ExpPillButton/ExpPillButton.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAW7D,MAAM,MAAM,iBAAiB,GAAG,OAAO,GAAG,MAAM,CAAC;AAEjD,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"ExpPillButton.d.ts","sourceRoot":"","sources":["../../src/expresivo/ExpPillButton/ExpPillButton.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAW7D,MAAM,MAAM,iBAAiB,GAAG,OAAO,GAAG,MAAM,CAAC;AAEjD,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,GAAG,MAAM,CAAC;AAE3E,MAAM,MAAM,iBAAiB,GAAG,IAAI,GAAG,IAAI,CAAC;AAE5C,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,CAAC,EAAE,iBAAiB,CAAC;IACzB,IAAI,CAAC,EAAE,iBAAiB,CAAC;IACzB,0FAA0F;IAC1F,IAAI,CAAC,EAAE,iBAAiB,CAAC;IACzB,sEAAsE;IACtE,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,wDAAwD;IACxD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6CAA6C;IAC7C,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,wFAAwF;IACxF,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,GAAG,oBAAoB,CAAC,iBAAiB,CAAC,CAAC;AA0E5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,aAAa,CAAC,EAC5B,IAAc,EACd,IAAa,EACb,IAAW,EACX,IAAY,EACZ,SAAS,EACT,KAAa,EACb,KAAa,EACb,QAAgB,EAChB,QAAQ,EACR,GAAG,SAAS,EACb,EAAE,kBAAkB,GAAG,SAAS,CAwEhC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import clsx from 'clsx';
|
|
3
|
-
import { FiLogIn, FiRefreshCw, FiSearch } from 'react-icons/fi';
|
|
3
|
+
import { FiLogIn, FiPlus, FiRefreshCw, FiSearch } from 'react-icons/fi';
|
|
4
4
|
import { Button } from '@clicoh/orion-library';
|
|
5
5
|
import { useExpScope } from '../ExpScope/ExpScope';
|
|
6
6
|
import { EnterGlyph, LensGlyph, SyncBadgeGlyph, SyncGlyph, } from '../shared/glyphs';
|
|
@@ -8,9 +8,36 @@ const fallbackIconMap = {
|
|
|
8
8
|
lens: <FiSearch />,
|
|
9
9
|
sync: <FiRefreshCw />,
|
|
10
10
|
enter: <FiLogIn />,
|
|
11
|
+
add: <FiPlus />,
|
|
11
12
|
none: undefined,
|
|
12
13
|
};
|
|
13
14
|
const liftClass = 'hover:-translate-y-px active:translate-y-0 active:scale-[.98]';
|
|
15
|
+
const sizeMap = {
|
|
16
|
+
md: {
|
|
17
|
+
text: 'gap-2.5 text-sm leading-5',
|
|
18
|
+
height: 'h-11',
|
|
19
|
+
padBare: 'px-6',
|
|
20
|
+
padDisc: 'pr-[22px] pl-1.5',
|
|
21
|
+
padGlyph: 'pr-[18px] pl-3',
|
|
22
|
+
disc: 'size-8',
|
|
23
|
+
lens: 22,
|
|
24
|
+
badge: 32,
|
|
25
|
+
glyph: 20,
|
|
26
|
+
plus: 'size-5',
|
|
27
|
+
},
|
|
28
|
+
sm: {
|
|
29
|
+
text: 'gap-1.5 text-xs leading-4',
|
|
30
|
+
height: 'h-8',
|
|
31
|
+
padBare: 'px-4',
|
|
32
|
+
padDisc: 'pr-4 pl-1',
|
|
33
|
+
padGlyph: 'pr-3.5 pl-2.5',
|
|
34
|
+
disc: 'size-6',
|
|
35
|
+
lens: 16,
|
|
36
|
+
badge: 24,
|
|
37
|
+
glyph: 16,
|
|
38
|
+
plus: 'size-4',
|
|
39
|
+
},
|
|
40
|
+
};
|
|
14
41
|
const toneMap = {
|
|
15
42
|
brand: {
|
|
16
43
|
idle: clsx('bg-lavender dark:bg-lavender-dark text-white shadow-[0_3px_10px_rgba(106,93,249,0.22)]', 'hover:from-lavender hover:to-violet hover:bg-linear-135 hover:shadow-[0_8px_20px_rgba(200,84,228,0.28)]'),
|
|
@@ -25,7 +52,7 @@ const toneMap = {
|
|
|
25
52
|
};
|
|
26
53
|
/**
|
|
27
54
|
* Light pill-shaped call to action, the same 44px height as the core
|
|
28
|
-
* `Button
|
|
55
|
+
* `Button` (32px with `size="sm"`). `brand` is a filled lavender pill that turns into the clicOH
|
|
29
56
|
* gradient on hover, with its glyph in a white disc; `soft` is a tinted pill
|
|
30
57
|
* for secondary actions, such as a button inside a field.
|
|
31
58
|
*
|
|
@@ -43,7 +70,8 @@ const toneMap = {
|
|
|
43
70
|
*
|
|
44
71
|
* @param {Object} props - The properties of the ExpPillButton component.
|
|
45
72
|
* @param {'brand' | 'soft'} [props.tone='brand'] - Filled lavender or tinted.
|
|
46
|
-
* @param {'lens' | 'sync' | 'enter' | 'none'} [props.icon='lens'] - Glyph before the label.
|
|
73
|
+
* @param {'lens' | 'sync' | 'enter' | 'add' | 'none'} [props.icon='lens'] - Glyph before the label; `add` is a plus, for an action that creates something.
|
|
74
|
+
* @param {'md' | 'sm'} [props.size='md'] - 44px tall, or 32px with a smaller label and glyph; outside an `ExpScope` it maps to the core `Button` `md` or `sm`.
|
|
47
75
|
* @param {boolean} [props.busy=false] - Blocks the button and animates its glyph.
|
|
48
76
|
* @param {string} [props.busyLabel] - Label shown while `busy`.
|
|
49
77
|
* @param {boolean} [props.block=false] - Takes the full width of its container.
|
|
@@ -53,24 +81,26 @@ const toneMap = {
|
|
|
53
81
|
*
|
|
54
82
|
* @returns {ReactNode} The rendered pill, or a core `Button` outside an `ExpScope`.
|
|
55
83
|
*/
|
|
56
|
-
export function ExpPillButton({ tone = 'brand', icon = 'lens', busy = false, busyLabel, block = false, flush = false, disabled = false, children, ...restProps }) {
|
|
84
|
+
export function ExpPillButton({ tone = 'brand', icon = 'lens', size = 'md', busy = false, busyLabel, block = false, flush = false, disabled = false, children, ...restProps }) {
|
|
57
85
|
const inScope = useExpScope();
|
|
58
86
|
const label = busy && busyLabel ? busyLabel : children;
|
|
87
|
+
const sizing = sizeMap[size];
|
|
59
88
|
if (!inScope) {
|
|
60
|
-
return (<Button {...restProps} modifier={tone === 'brand' ? 'principal' : 'second'} iconL={fallbackIconMap[icon]} disabled={disabled || busy} aria-busy={busy || undefined} className={clsx(block && 'w-full', restProps.className)}>
|
|
89
|
+
return (<Button {...restProps} modifier={tone === 'brand' ? 'principal' : 'second'} size={size} iconL={fallbackIconMap[icon]} disabled={disabled || busy} aria-busy={busy || undefined} className={clsx(block && 'w-full', restProps.className)}>
|
|
61
90
|
{label}
|
|
62
91
|
</Button>);
|
|
63
92
|
}
|
|
64
93
|
const state = disabled ? 'disabled' : busy ? 'busy' : 'idle';
|
|
65
94
|
const hasDisc = tone === 'brand' && (icon === 'lens' || icon === 'sync');
|
|
66
|
-
return (<button {...restProps} disabled={disabled || busy} aria-busy={busy || undefined} className={clsx('items-center
|
|
67
|
-
{tone === 'brand' && icon === 'lens' && (<span aria-hidden="true" className={clsx('flex
|
|
68
|
-
<LensGlyph size={
|
|
95
|
+
return (<button {...restProps} disabled={disabled || busy} aria-busy={busy || undefined} className={clsx('items-center rounded-full font-semibold whitespace-nowrap', 'transition-[background-color,box-shadow,translate,scale] duration-200 motion-reduce:translate-none motion-reduce:scale-none motion-reduce:transition-none', sizing.text, flush ? 'h-full' : sizing.height, !flush && state === 'idle' && liftClass, block ? 'flex w-full justify-center' : 'inline-flex', icon === 'none' && sizing.padBare, icon !== 'none' && (hasDisc ? sizing.padDisc : sizing.padGlyph), toneMap[tone][state], restProps.className)}>
|
|
96
|
+
{tone === 'brand' && icon === 'lens' && (<span aria-hidden="true" className={clsx('flex shrink-0 items-center justify-center rounded-full', sizing.disc, disabled ? 'bg-gray-6' : 'bg-white')}>
|
|
97
|
+
<LensGlyph size={sizing.lens} busy={busy} disabled={disabled}/>
|
|
69
98
|
</span>)}
|
|
70
|
-
{tone === 'brand' && icon === 'sync' && (<SyncBadgeGlyph size={
|
|
71
|
-
{tone === 'soft' && icon === 'lens' && (<LensGlyph size={
|
|
72
|
-
{tone === 'soft' && icon === 'sync' && (<SyncGlyph size={
|
|
73
|
-
{icon === 'enter' && (<EnterGlyph size={
|
|
99
|
+
{tone === 'brand' && icon === 'sync' && (<SyncBadgeGlyph size={sizing.badge} busy={busy} disabled={disabled}/>)}
|
|
100
|
+
{tone === 'soft' && icon === 'lens' && (<LensGlyph size={sizing.glyph} busy={busy} disabled={disabled}/>)}
|
|
101
|
+
{tone === 'soft' && icon === 'sync' && (<SyncGlyph size={sizing.glyph} busy={busy} disabled={disabled}/>)}
|
|
102
|
+
{icon === 'enter' && (<EnterGlyph size={sizing.glyph} busy={busy} disabled={disabled}/>)}
|
|
103
|
+
{icon === 'add' && (<FiPlus aria-hidden="true" className={clsx('shrink-0', sizing.plus)}/>)}
|
|
74
104
|
{label}
|
|
75
105
|
</button>);
|
|
76
106
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpPillButton.jsx","sourceRoot":"","sources":["../../src/expresivo/ExpPillButton/ExpPillButton.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"ExpPillButton.jsx","sourceRoot":"","sources":["../../src/expresivo/ExpPillButton/ExpPillButton.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACxE,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EACL,UAAU,EACV,SAAS,EACT,cAAc,EACd,SAAS,GACV,MAAM,kBAAkB,CAAC;AAyB1B,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CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,EAAG,CACvE,CACD;MAAA,CAAC,IAAI,KAAK,MAAM,IAAI,IAAI,KAAK,MAAM,IAAI,CACrC,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,EAAG,CAClE,CACD;MAAA,CAAC,IAAI,KAAK,MAAM,IAAI,IAAI,KAAK,MAAM,IAAI,CACrC,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,EAAG,CAClE,CACD;MAAA,CAAC,IAAI,KAAK,OAAO,IAAI,CACnB,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,EAAG,CACnE,CACD;MAAA,CAAC,IAAI,KAAK,KAAK,IAAI,CACjB,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC,EAAG,CACxE,CACD;MAAA,CAAC,KAAK,CACR;IAAA,EAAE,MAAM,CAAC,CACV,CAAC;AACJ,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { ExpPillButton } from './ExpPillButton';
|
|
2
|
-
export type { ExpPillButtonIcon, ExpPillButtonProps, ExpPillButtonTone, } from './ExpPillButton';
|
|
2
|
+
export type { ExpPillButtonIcon, ExpPillButtonProps, ExpPillButtonSize, ExpPillButtonTone, } from './ExpPillButton';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/expresivo/ExpPillButton/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EACV,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/expresivo/ExpPillButton/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EACV,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { TabList } from '@clicoh/orion-library';
|
|
2
|
+
import { type ComponentProps, type ReactNode } from 'react';
|
|
3
|
+
import type { ExpMascotName } from '../ExpMascot/catalog';
|
|
4
|
+
export type ExpTabsProps = {
|
|
5
|
+
/** Same items as the core `TabList`: `title`, optional `icon` and `count`, and the panel as `children`. */
|
|
6
|
+
list: ComponentProps<typeof TabList>['list'];
|
|
7
|
+
/** Accessible name of the row of tabs. */
|
|
8
|
+
ariaLabel: string;
|
|
9
|
+
/** Called with the index of the tab the user opens. */
|
|
10
|
+
callback?: (index: number) => void;
|
|
11
|
+
/** Index of the tab open on mount. */
|
|
12
|
+
firstActiveTab?: number;
|
|
13
|
+
/** Mascot that peeks from behind the end of the row, from `lg` up. Decorative. */
|
|
14
|
+
peek?: ExpMascotName;
|
|
15
|
+
/** Shows the `peek` below `lg` too. Only when the tabs fit a phone's width: the rail scrolls otherwise. */
|
|
16
|
+
narrowPeek?: boolean;
|
|
17
|
+
className?: string;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Tabs as a pill rail: the open tab is a white pill that slides to the tab
|
|
21
|
+
* the user picks. Arrow keys, Home and End move between tabs. `peek` puts a
|
|
22
|
+
* mascot behind the end of the rail, from `lg` up, or at every width with
|
|
23
|
+
* `narrowPeek`.
|
|
24
|
+
*
|
|
25
|
+
* The panel of the open tab renders below the rail, as in the core
|
|
26
|
+
* `TabList`. Outside an `ExpScope` it falls back to `TabList` `second` with
|
|
27
|
+
* the same `list`.
|
|
28
|
+
*
|
|
29
|
+
* @component
|
|
30
|
+
* @example
|
|
31
|
+
* <ExpTabs
|
|
32
|
+
* ariaLabel="Search type"
|
|
33
|
+
* peek="bugi-05-sorprendido"
|
|
34
|
+
* list={[
|
|
35
|
+
* { title: 'Messages', children: <MessageSearch /> },
|
|
36
|
+
* { title: 'Routes', children: <RouteSearch /> },
|
|
37
|
+
* ]}
|
|
38
|
+
* />
|
|
39
|
+
*
|
|
40
|
+
* @param {ExpTabsProps} props - The properties of the ExpTabs component.
|
|
41
|
+
* @param {Array<Object>} props.list - Tabs with `title`, optional `icon` and `count`, and the panel as `children`.
|
|
42
|
+
* @param {string} props.ariaLabel - Accessible name of the row of tabs.
|
|
43
|
+
* @param {(index: number) => void} [props.callback] - Called with the index of the tab the user opens.
|
|
44
|
+
* @param {number} [props.firstActiveTab=0] - Index of the tab open on mount.
|
|
45
|
+
* @param {ExpMascotName} [props.peek] - Mascot behind the end of the rail, from `lg` up.
|
|
46
|
+
* @param {boolean} [props.narrowPeek=false] - Shows the `peek` below `lg` too.
|
|
47
|
+
* @param {string} [props.className] - Classes for the wrapper.
|
|
48
|
+
*
|
|
49
|
+
* @returns {ReactNode} The rail and the open panel, or a core `TabList` outside an `ExpScope`.
|
|
50
|
+
*/
|
|
51
|
+
export declare function ExpTabs({ list, ariaLabel, callback, firstActiveTab, peek, narrowPeek, className, }: ExpTabsProps): ReactNode;
|
|
52
|
+
//# sourceMappingURL=ExpTabs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExpTabs.d.ts","sourceRoot":"","sources":["../../src/expresivo/ExpTabs/ExpTabs.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAQ,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAEtD,OAAO,EACL,KAAK,cAAc,EAEnB,KAAK,SAAS,EAKf,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAK1D,MAAM,MAAM,YAAY,GAAG;IACzB,2GAA2G;IAC3G,IAAI,EAAE,cAAc,CAAC,OAAO,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC;IAC7C,0CAA0C;IAC1C,SAAS,EAAE,MAAM,CAAC;IAClB,uDAAuD;IACvD,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,sCAAsC;IACtC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,kFAAkF;IAClF,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,2GAA2G;IAC3G,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAKF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,OAAO,CAAC,EACtB,IAAI,EACJ,SAAS,EACT,QAAQ,EACR,cAAkB,EAClB,IAAI,EACJ,UAAkB,EAClB,SAAS,GACV,EAAE,YAAY,GAAG,SAAS,CAoI1B"}
|