@clicoh/orion-library 1.2.0-beta.22 → 1.2.0-beta.24
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/avatares/caja-ruedas.svg +1 -0
- package/assets/avatares/cohete-azul.svg +1 -0
- package/assets/avatares/criatura-tres-ojos.svg +1 -0
- package/assets/avatares/cubo-brazos.svg +1 -0
- package/assets/avatares/cubo-morado.svg +1 -0
- package/assets/avatares/dino-placas-amarillas.svg +1 -0
- package/assets/avatares/dino-placas-azules.svg +1 -0
- package/assets/avatares/edificio-cupulas.svg +1 -0
- package/assets/avatares/globo-anillo.svg +1 -0
- package/assets/avatares/pulpo-morado.svg +1 -0
- package/assets/avatares/robot-lente.svg +1 -0
- package/assets/avatares/ventana-codigo.svg +1 -0
- package/assets/css/expresivo.css +37 -0
- package/dist/components/00-base/RootLayout/RootLayout.d.ts.map +1 -1
- package/dist/components/00-base/RootLayout/RootLayout.jsx +1 -0
- package/dist/components/00-base/RootLayout/RootLayout.jsx.map +1 -1
- package/dist/components/01-atoms/ChipButton/ChipButton.d.ts +24 -0
- package/dist/components/01-atoms/ChipButton/ChipButton.d.ts.map +1 -0
- package/dist/components/01-atoms/ChipButton/ChipButton.jsx +26 -0
- package/dist/components/01-atoms/ChipButton/ChipButton.jsx.map +1 -0
- package/dist/components/01-atoms/ChipButton/index.d.ts +2 -0
- package/dist/components/01-atoms/ChipButton/index.d.ts.map +1 -0
- package/dist/components/01-atoms/ChipButton/index.js +2 -0
- package/dist/components/01-atoms/ChipButton/index.js.map +1 -0
- package/dist/components/01-atoms/CodeBlock/CodeBlock.d.ts +11 -3
- package/dist/components/01-atoms/CodeBlock/CodeBlock.d.ts.map +1 -1
- package/dist/components/01-atoms/CodeBlock/CodeBlock.jsx +13 -5
- package/dist/components/01-atoms/CodeBlock/CodeBlock.jsx.map +1 -1
- package/dist/components/01-atoms/MultiSelect/MultiSelect.d.ts.map +1 -1
- package/dist/components/01-atoms/MultiSelect/MultiSelect.jsx +12 -8
- package/dist/components/01-atoms/MultiSelect/MultiSelect.jsx.map +1 -1
- package/dist/components/01-atoms/OtpInput/OtpInput.d.ts +1 -1
- package/dist/components/01-atoms/OtpInput/OtpInput.jsx +3 -2
- package/dist/components/01-atoms/OtpInput/OtpInput.jsx.map +1 -1
- package/dist/components/01-atoms/Radio/Radio.d.ts.map +1 -1
- package/dist/components/01-atoms/Radio/Radio.jsx +2 -0
- package/dist/components/01-atoms/Radio/Radio.jsx.map +1 -1
- package/dist/components/01-atoms/Select/SelectList.d.ts.map +1 -1
- package/dist/components/01-atoms/Select/SelectList.jsx +1 -0
- package/dist/components/01-atoms/Select/SelectList.jsx.map +1 -1
- package/dist/components/01-atoms/Switch/Switch.d.ts.map +1 -1
- package/dist/components/01-atoms/Switch/Switch.jsx +11 -7
- package/dist/components/01-atoms/Switch/Switch.jsx.map +1 -1
- package/dist/components/01-atoms/index.d.ts +1 -0
- package/dist/components/01-atoms/index.d.ts.map +1 -1
- package/dist/components/01-atoms/index.js +1 -0
- package/dist/components/01-atoms/index.js.map +1 -1
- package/dist/components/02-molecules/ActionMenu/ActionMenu.d.ts +39 -0
- package/dist/components/02-molecules/ActionMenu/ActionMenu.d.ts.map +1 -0
- package/dist/components/02-molecules/ActionMenu/ActionMenu.jsx +36 -0
- package/dist/components/02-molecules/ActionMenu/ActionMenu.jsx.map +1 -0
- package/dist/components/02-molecules/ActionMenu/index.d.ts +2 -0
- package/dist/components/02-molecules/ActionMenu/index.d.ts.map +1 -0
- package/dist/components/02-molecules/ActionMenu/index.js +2 -0
- package/dist/components/02-molecules/ActionMenu/index.js.map +1 -0
- package/dist/components/02-molecules/Autocomplete/Autocomplete.d.ts.map +1 -1
- package/dist/components/02-molecules/Autocomplete/Autocomplete.jsx +52 -47
- package/dist/components/02-molecules/Autocomplete/Autocomplete.jsx.map +1 -1
- package/dist/components/02-molecules/DatePicker/DatePicker.d.ts.map +1 -1
- package/dist/components/02-molecules/DatePicker/DatePicker.jsx +11 -6
- package/dist/components/02-molecules/DatePicker/DatePicker.jsx.map +1 -1
- package/dist/components/02-molecules/Dropdown/Dropdown.jsx +6 -6
- package/dist/components/02-molecules/Dropdown/Dropdown.jsx.map +1 -1
- package/dist/components/02-molecules/Filter/Filter.d.ts.map +1 -1
- package/dist/components/02-molecules/Filter/Filter.jsx +17 -8
- package/dist/components/02-molecules/Filter/Filter.jsx.map +1 -1
- package/dist/components/02-molecules/Menu/MenuList.d.ts.map +1 -1
- package/dist/components/02-molecules/Menu/MenuList.jsx +8 -5
- package/dist/components/02-molecules/Menu/MenuList.jsx.map +1 -1
- package/dist/components/02-molecules/Tab/TabList.d.ts.map +1 -1
- package/dist/components/02-molecules/Tab/TabList.jsx +10 -6
- package/dist/components/02-molecules/Tab/TabList.jsx.map +1 -1
- package/dist/components/02-molecules/Table/Table.d.ts.map +1 -1
- package/dist/components/02-molecules/Table/Table.jsx +9 -14
- package/dist/components/02-molecules/Table/Table.jsx.map +1 -1
- package/dist/components/02-molecules/TimePicker/TimePicker.d.ts.map +1 -1
- package/dist/components/02-molecules/TimePicker/TimePicker.jsx +8 -6
- package/dist/components/02-molecules/TimePicker/TimePicker.jsx.map +1 -1
- package/dist/components/02-molecules/index.d.ts +1 -0
- package/dist/components/02-molecules/index.d.ts.map +1 -1
- package/dist/components/02-molecules/index.js +1 -0
- package/dist/components/02-molecules/index.js.map +1 -1
- package/dist/components/03-organisms/BarChart/BarChart.d.ts +52 -0
- package/dist/components/03-organisms/BarChart/BarChart.d.ts.map +1 -0
- package/dist/components/03-organisms/BarChart/BarChart.jsx +116 -0
- package/dist/components/03-organisms/BarChart/BarChart.jsx.map +1 -0
- package/dist/components/03-organisms/BarChart/index.d.ts +2 -0
- package/dist/components/03-organisms/BarChart/index.d.ts.map +1 -0
- package/dist/components/03-organisms/BarChart/index.js +2 -0
- package/dist/components/03-organisms/BarChart/index.js.map +1 -0
- package/dist/components/03-organisms/DataTable/DataTable.d.ts +5 -2
- package/dist/components/03-organisms/DataTable/DataTable.d.ts.map +1 -1
- package/dist/components/03-organisms/DataTable/DataTable.jsx +10 -7
- package/dist/components/03-organisms/DataTable/DataTable.jsx.map +1 -1
- package/dist/components/03-organisms/index.d.ts +1 -0
- package/dist/components/03-organisms/index.d.ts.map +1 -1
- package/dist/components/03-organisms/index.js +1 -0
- package/dist/components/03-organisms/index.js.map +1 -1
- package/dist/components/04-templates/LoginTemplate/LoginForm.d.ts +6 -1
- package/dist/components/04-templates/LoginTemplate/LoginForm.d.ts.map +1 -1
- package/dist/components/04-templates/LoginTemplate/LoginForm.jsx +35 -9
- package/dist/components/04-templates/LoginTemplate/LoginForm.jsx.map +1 -1
- package/dist/components/04-templates/LoginTemplate/SetupMfa/StepThree.d.ts.map +1 -1
- package/dist/components/04-templates/LoginTemplate/SetupMfa/StepThree.jsx +8 -4
- package/dist/components/04-templates/LoginTemplate/SetupMfa/StepThree.jsx.map +1 -1
- package/dist/components/04-templates/LoginTemplate/SetupMfa/StepTwo.d.ts.map +1 -1
- package/dist/components/04-templates/LoginTemplate/SetupMfa/StepTwo.jsx +10 -3
- package/dist/components/04-templates/LoginTemplate/SetupMfa/StepTwo.jsx.map +1 -1
- package/dist/components/04-templates/LoginTemplate/index.d.ts +1 -1
- package/dist/components/04-templates/LoginTemplate/index.d.ts.map +1 -1
- package/dist/components/04-templates/LoginTemplate/submitOnEnter.d.ts +9 -0
- package/dist/components/04-templates/LoginTemplate/submitOnEnter.d.ts.map +1 -0
- package/dist/components/04-templates/LoginTemplate/submitOnEnter.js +15 -0
- package/dist/components/04-templates/LoginTemplate/submitOnEnter.js.map +1 -0
- package/expresivo/ExpAccentNote/ExpAccentNote.d.ts +25 -0
- package/expresivo/ExpAccentNote/ExpAccentNote.d.ts.map +1 -0
- package/expresivo/ExpAccentNote/ExpAccentNote.jsx +47 -0
- package/expresivo/ExpAccentNote/ExpAccentNote.jsx.map +1 -0
- package/expresivo/ExpAccentNote/index.d.ts +2 -0
- package/expresivo/ExpAccentNote/index.d.ts.map +1 -0
- package/expresivo/ExpAccentNote/index.js +2 -0
- package/expresivo/ExpAccentNote/index.js.map +1 -0
- package/expresivo/ExpCodeHostIcon/ExpCodeHostIcon.d.ts +29 -0
- package/expresivo/ExpCodeHostIcon/ExpCodeHostIcon.d.ts.map +1 -0
- package/expresivo/ExpCodeHostIcon/ExpCodeHostIcon.jsx +44 -0
- package/expresivo/ExpCodeHostIcon/ExpCodeHostIcon.jsx.map +1 -0
- package/expresivo/ExpCodeHostIcon/index.d.ts +2 -0
- package/expresivo/ExpCodeHostIcon/index.d.ts.map +1 -0
- package/expresivo/ExpCodeHostIcon/index.js +2 -0
- package/expresivo/ExpCodeHostIcon/index.js.map +1 -0
- package/expresivo/ExpFigureBand/ExpFigureBand.d.ts +61 -0
- package/expresivo/ExpFigureBand/ExpFigureBand.d.ts.map +1 -0
- package/expresivo/ExpFigureBand/ExpFigureBand.jsx +102 -0
- package/expresivo/ExpFigureBand/ExpFigureBand.jsx.map +1 -0
- package/expresivo/ExpFigureBand/index.d.ts +2 -0
- package/expresivo/ExpFigureBand/index.d.ts.map +1 -0
- package/expresivo/ExpFigureBand/index.js +2 -0
- package/expresivo/ExpFigureBand/index.js.map +1 -0
- package/expresivo/ExpGrowBar/ExpGrowBar.d.ts +13 -2
- package/expresivo/ExpGrowBar/ExpGrowBar.d.ts.map +1 -1
- package/expresivo/ExpGrowBar/ExpGrowBar.jsx +16 -4
- package/expresivo/ExpGrowBar/ExpGrowBar.jsx.map +1 -1
- package/expresivo/ExpJourneyTrack/ExpJourneyTrack.d.ts.map +1 -1
- package/expresivo/ExpJourneyTrack/ExpJourneyTrack.jsx +23 -9
- package/expresivo/ExpJourneyTrack/ExpJourneyTrack.jsx.map +1 -1
- package/expresivo/ExpLogo/ExpLogo.d.ts.map +1 -1
- package/expresivo/ExpLogo/ExpLogo.jsx +3 -0
- package/expresivo/ExpLogo/ExpLogo.jsx.map +1 -1
- package/expresivo/ExpMascot/ExpMascot.d.ts.map +1 -1
- package/expresivo/ExpMascot/ExpMascot.jsx +1 -0
- package/expresivo/ExpMascot/ExpMascot.jsx.map +1 -1
- package/expresivo/ExpRepoAvatar/ExpRepoAvatar.d.ts +3 -0
- package/expresivo/ExpRepoAvatar/ExpRepoAvatar.d.ts.map +1 -1
- package/expresivo/ExpRepoAvatar/ExpRepoAvatar.jsx +4 -0
- package/expresivo/ExpRepoAvatar/ExpRepoAvatar.jsx.map +1 -1
- package/expresivo/ExpRepoAvatar/catalog.d.ts +6 -2
- package/expresivo/ExpRepoAvatar/catalog.d.ts.map +1 -1
- package/expresivo/ExpRepoAvatar/catalog.js +29 -1
- package/expresivo/ExpRepoAvatar/catalog.js.map +1 -1
- package/expresivo/ExpSplitCard/ExpSplitCard.d.ts +38 -0
- package/expresivo/ExpSplitCard/ExpSplitCard.d.ts.map +1 -0
- package/expresivo/ExpSplitCard/ExpSplitCard.jsx +48 -0
- package/expresivo/ExpSplitCard/ExpSplitCard.jsx.map +1 -0
- package/expresivo/ExpSplitCard/index.d.ts +2 -0
- package/expresivo/ExpSplitCard/index.d.ts.map +1 -0
- package/expresivo/ExpSplitCard/index.js +2 -0
- package/expresivo/ExpSplitCard/index.js.map +1 -0
- package/expresivo/ExpStatIcon/ExpStatIcon.d.ts.map +1 -1
- package/expresivo/ExpStatIcon/ExpStatIcon.jsx +1 -0
- package/expresivo/ExpStatIcon/ExpStatIcon.jsx.map +1 -1
- package/expresivo/ExpStatusTag/ExpStatusTag.d.ts +26 -0
- package/expresivo/ExpStatusTag/ExpStatusTag.d.ts.map +1 -0
- package/expresivo/ExpStatusTag/ExpStatusTag.jsx +44 -0
- package/expresivo/ExpStatusTag/ExpStatusTag.jsx.map +1 -0
- package/expresivo/ExpStatusTag/index.d.ts +2 -0
- package/expresivo/ExpStatusTag/index.d.ts.map +1 -0
- package/expresivo/ExpStatusTag/index.js +2 -0
- package/expresivo/ExpStatusTag/index.js.map +1 -0
- package/expresivo/index.d.ts +5 -0
- package/expresivo/index.d.ts.map +1 -1
- package/expresivo/index.js +5 -0
- package/expresivo/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"submitOnEnter.js","sourceRoot":"","sources":["../../../../src/components/04-templates/LoginTemplate/submitOnEnter.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAAC,KAAqC;IACjE,IAAI,KAAK,CAAC,GAAG,KAAK,OAAO,IAAI,KAAK,CAAC,WAAW,CAAC,WAAW;QAAE,OAAO;IACnE,IAAI,CAAC,CAAC,KAAK,CAAC,MAAM,YAAY,gBAAgB,CAAC;QAAE,OAAO;IACxD,KAAK,CAAC,cAAc,EAAE,CAAC;IACvB,KAAK,CAAC,aAAa,CAAC,aAAa,EAAE,CAAC;AACtC,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export type ExpAccentNoteProps = {
|
|
3
|
+
label: ReactNode;
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
} & Omit<HTMLAttributes<HTMLDivElement>, 'children'>;
|
|
6
|
+
/**
|
|
7
|
+
* Short note with a thin clicOH gradient bar on its left: an uppercase `label`
|
|
8
|
+
* in the accent color and a line or two of gray text under it. For one fact
|
|
9
|
+
* under a page title, such as the scope a page covers. The bar is decorative.
|
|
10
|
+
*
|
|
11
|
+
* Outside an `ExpScope` it falls back to two core `Paragraph`s: the label in
|
|
12
|
+
* semibold and the text in gray.
|
|
13
|
+
*
|
|
14
|
+
* @component
|
|
15
|
+
* @example
|
|
16
|
+
* <ExpAccentNote label="Authorized scope · v1">38 repos, 18 high priority.</ExpAccentNote>
|
|
17
|
+
*
|
|
18
|
+
* @param {ExpAccentNoteProps} props - The properties of the ExpAccentNote component.
|
|
19
|
+
* @param {ReactNode} props.label - Short line above the text, shown in uppercase.
|
|
20
|
+
* @param {ReactNode} props.children - Text of the note.
|
|
21
|
+
*
|
|
22
|
+
* @returns {ReactNode} The note, or two core `Paragraph`s outside an `ExpScope`.
|
|
23
|
+
*/
|
|
24
|
+
export declare function ExpAccentNote({ label, children, ...restProps }: ExpAccentNoteProps): ReactNode;
|
|
25
|
+
//# sourceMappingURL=ExpAccentNote.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExpAccentNote.d.ts","sourceRoot":"","sources":["../../src/expresivo/ExpAccentNote/ExpAccentNote.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,EAAE,SAAS,CAAC;IACjB,QAAQ,EAAE,SAAS,CAAC;CACrB,GAAG,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC,CAAC;AAErD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,QAAQ,EACR,GAAG,SAAS,EACb,EAAE,kBAAkB,GAAG,SAAS,CAmChC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { Paragraph } from '@clicoh/orion-library';
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
import { useExpScope } from '../ExpScope/ExpScope';
|
|
5
|
+
/**
|
|
6
|
+
* Short note with a thin clicOH gradient bar on its left: an uppercase `label`
|
|
7
|
+
* in the accent color and a line or two of gray text under it. For one fact
|
|
8
|
+
* under a page title, such as the scope a page covers. The bar is decorative.
|
|
9
|
+
*
|
|
10
|
+
* Outside an `ExpScope` it falls back to two core `Paragraph`s: the label in
|
|
11
|
+
* semibold and the text in gray.
|
|
12
|
+
*
|
|
13
|
+
* @component
|
|
14
|
+
* @example
|
|
15
|
+
* <ExpAccentNote label="Authorized scope · v1">38 repos, 18 high priority.</ExpAccentNote>
|
|
16
|
+
*
|
|
17
|
+
* @param {ExpAccentNoteProps} props - The properties of the ExpAccentNote component.
|
|
18
|
+
* @param {ReactNode} props.label - Short line above the text, shown in uppercase.
|
|
19
|
+
* @param {ReactNode} props.children - Text of the note.
|
|
20
|
+
*
|
|
21
|
+
* @returns {ReactNode} The note, or two core `Paragraph`s outside an `ExpScope`.
|
|
22
|
+
*/
|
|
23
|
+
export function ExpAccentNote({ label, children, ...restProps }) {
|
|
24
|
+
const inScope = useExpScope();
|
|
25
|
+
if (!inScope) {
|
|
26
|
+
return (<div {...restProps} className={clsx('flex flex-col gap-0.5', restProps.className)}>
|
|
27
|
+
<Paragraph size="body-2" weight="semibold">
|
|
28
|
+
{label}
|
|
29
|
+
</Paragraph>
|
|
30
|
+
<Paragraph size="body-2" className="text-gray-1 dark:text-gray-2">
|
|
31
|
+
{children}
|
|
32
|
+
</Paragraph>
|
|
33
|
+
</div>);
|
|
34
|
+
}
|
|
35
|
+
return (<div {...restProps} className={clsx('flex gap-3', restProps.className)}>
|
|
36
|
+
<span aria-hidden="true" className="from-lavender via-violet to-warning w-[3px] shrink-0 rounded-[3px] bg-linear-to-b via-60%"/>
|
|
37
|
+
<div className="flex min-w-0 flex-col gap-0.5">
|
|
38
|
+
<p className="text-lavender dark:text-lavender-dark text-xs leading-4 font-semibold tracking-[0.04em] uppercase">
|
|
39
|
+
{label}
|
|
40
|
+
</p>
|
|
41
|
+
<p className="text-gray-1 dark:text-gray-2 text-sm leading-[22px] text-pretty">
|
|
42
|
+
{children}
|
|
43
|
+
</p>
|
|
44
|
+
</div>
|
|
45
|
+
</div>);
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=ExpAccentNote.jsx.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExpAccentNote.jsx","sourceRoot":"","sources":["../../src/expresivo/ExpAccentNote/ExpAccentNote.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,IAAI,MAAM,M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|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/expresivo/ExpAccentNote/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/expresivo/ExpAccentNote/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export type ExpCodeHostName = 'github' | 'bitbucket';
|
|
3
|
+
export type ExpCodeHostIconProps = {
|
|
4
|
+
name: ExpCodeHostName;
|
|
5
|
+
/** Width and height on screen, in pixels. */
|
|
6
|
+
size?: number;
|
|
7
|
+
} & Omit<HTMLAttributes<HTMLSpanElement>, 'children'>;
|
|
8
|
+
/**
|
|
9
|
+
* Mark of the service that hosts a repository, to put before its name, such as
|
|
10
|
+
* in an origin column. Decorative: always `aria-hidden`, so the name next to it
|
|
11
|
+
* carries the meaning.
|
|
12
|
+
*
|
|
13
|
+
* Outside an `ExpScope` it renders nothing.
|
|
14
|
+
*
|
|
15
|
+
* @component
|
|
16
|
+
* @example
|
|
17
|
+
* <span className="flex items-center gap-2">
|
|
18
|
+
* <ExpCodeHostIcon name="github" />
|
|
19
|
+
* GitHub
|
|
20
|
+
* </span>
|
|
21
|
+
*
|
|
22
|
+
* @param {ExpCodeHostIconProps} props - The properties of the ExpCodeHostIcon component.
|
|
23
|
+
* @param {'github' | 'bitbucket'} props.name - The hosting service.
|
|
24
|
+
* @param {number} [props.size=20] - Width and height on screen, in pixels.
|
|
25
|
+
*
|
|
26
|
+
* @returns {ReactNode} The mark, or nothing outside an `ExpScope`.
|
|
27
|
+
*/
|
|
28
|
+
export declare function ExpCodeHostIcon({ name, size, ...restProps }: ExpCodeHostIconProps): ReactNode;
|
|
29
|
+
//# sourceMappingURL=ExpCodeHostIcon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExpCodeHostIcon.d.ts","sourceRoot":"","sources":["../../src/expresivo/ExpCodeHostIcon/ExpCodeHostIcon.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKvD,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,WAAW,CAAC;AAErD,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,EAAE,eAAe,CAAC;IACtB,6CAA6C;IAC7C,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,GAAG,IAAI,CAAC,cAAc,CAAC,eAAe,CAAC,EAAE,UAAU,CAAC,CAAC;AActD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,eAAe,CAAC,EAC9B,IAAI,EACJ,IAAS,EACT,GAAG,SAAS,EACb,EAAE,oBAAoB,GAAG,SAAS,CAoBlC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import { FaBitbucket, FaGithub } from 'react-icons/fa';
|
|
4
|
+
import { useExpScope } from '../ExpScope/ExpScope';
|
|
5
|
+
const iconMap = {
|
|
6
|
+
github: FaGithub,
|
|
7
|
+
bitbucket: FaBitbucket,
|
|
8
|
+
};
|
|
9
|
+
// GitHub's mark is monochrome, so it follows the text; Bitbucket keeps its blue,
|
|
10
|
+
// which the `info` token matches.
|
|
11
|
+
const colorMap = {
|
|
12
|
+
github: 'text-black dark:text-white',
|
|
13
|
+
bitbucket: 'text-info dark:text-info-dark',
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Mark of the service that hosts a repository, to put before its name, such as
|
|
17
|
+
* in an origin column. Decorative: always `aria-hidden`, so the name next to it
|
|
18
|
+
* carries the meaning.
|
|
19
|
+
*
|
|
20
|
+
* Outside an `ExpScope` it renders nothing.
|
|
21
|
+
*
|
|
22
|
+
* @component
|
|
23
|
+
* @example
|
|
24
|
+
* <span className="flex items-center gap-2">
|
|
25
|
+
* <ExpCodeHostIcon name="github" />
|
|
26
|
+
* GitHub
|
|
27
|
+
* </span>
|
|
28
|
+
*
|
|
29
|
+
* @param {ExpCodeHostIconProps} props - The properties of the ExpCodeHostIcon component.
|
|
30
|
+
* @param {'github' | 'bitbucket'} props.name - The hosting service.
|
|
31
|
+
* @param {number} [props.size=20] - Width and height on screen, in pixels.
|
|
32
|
+
*
|
|
33
|
+
* @returns {ReactNode} The mark, or nothing outside an `ExpScope`.
|
|
34
|
+
*/
|
|
35
|
+
export function ExpCodeHostIcon({ name, size = 20, ...restProps }) {
|
|
36
|
+
const inScope = useExpScope();
|
|
37
|
+
if (!inScope)
|
|
38
|
+
return null;
|
|
39
|
+
const Icon = iconMap[name];
|
|
40
|
+
return (<span {...restProps} aria-hidden="true" className={clsx('inline-flex shrink-0', colorMap[name], restProps.className)}>
|
|
41
|
+
<Icon size={size}/>
|
|
42
|
+
</span>);
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=ExpCodeHostIcon.jsx.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExpCodeHostIcon.jsx","sourceRoot":"","sources":["../../src/expresivo/ExpCodeHostIcon/ExpCodeHostIcon.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAUnD,MAAM,OAAO,GAAsC;IACjD,MAAM,EAAE,QAAQ;IAChB,SAAS,EAAE,WAAW;CACvB,CAAC;AAEF,iFAAiF;AACjF,kCAAkC;AAClC,MAAM,QAAQ,GAAoC;IAChD,MAAM,EAAE,4BAA4B;IACpC,SAAS,EAAE,+BAA+B;CAC3C,CAAC;AAEF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,eAAe,CAAC,EAC9B,IAAI,EACJ,IAAI,GAAG,EAAE,EACT,GAAG,SAAS,EACS;IACrB,MAAM,OAAO,GAAG,WAAW,EAAE,CAAC;IAE9B,IAAI,CAAC,OAAO;QAAE,OAAO,IAAI,CAAC;IAE1B,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE3B,OAAO,CACL,CAAC,IAAI,CACH,IAAI,SAAS,CAAC,CACd,WAAW,CAAC,MAAM,CAClB,SAAS,CAAC,CAAC,IAAI,CACb,sBAAsB,EACtB,QAAQ,CAAC,IAAI,CAAC,EACd,SAAS,CAAC,SAAS,CACpB,CAAC,CAEF;MAAA,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,EACnB;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/expresivo/ExpCodeHostIcon/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/expresivo/ExpCodeHostIcon/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export type ExpFigureBandTone = 'accent' | 'success' | 'warning' | 'error';
|
|
3
|
+
export type ExpFigure = {
|
|
4
|
+
/** The figure, already formatted. */
|
|
5
|
+
value: ReactNode;
|
|
6
|
+
/** What the figure measures. */
|
|
7
|
+
label: string;
|
|
8
|
+
/** Short context under the label. */
|
|
9
|
+
hint?: string;
|
|
10
|
+
};
|
|
11
|
+
export type ExpFigureHighlight = ExpFigure & {
|
|
12
|
+
/** Short uppercase line above the label, in the tone color. */
|
|
13
|
+
eyebrow?: string;
|
|
14
|
+
/** Color of the eyebrow. Never the only signal: the eyebrow says it in words. */
|
|
15
|
+
tone?: ExpFigureBandTone;
|
|
16
|
+
};
|
|
17
|
+
export type ExpFigureBandProps = {
|
|
18
|
+
/** The main figure, large, at the start of the band. */
|
|
19
|
+
lead: ExpFigureHighlight;
|
|
20
|
+
/** Smaller figures, in the middle. */
|
|
21
|
+
figures?: ExpFigure[];
|
|
22
|
+
/** A figure to act on, large, at the end of the band: a gap, a backlog. */
|
|
23
|
+
callout?: ExpFigureHighlight;
|
|
24
|
+
/** Holds the space with placeholders while the values load. */
|
|
25
|
+
isLoading?: boolean;
|
|
26
|
+
} & Omit<HTMLAttributes<HTMLElement>, 'children'>;
|
|
27
|
+
/**
|
|
28
|
+
* One band with the figures that sum up a list: a large figure at the start,
|
|
29
|
+
* smaller ones in the middle and, at the end, a large one to act on, such as a
|
|
30
|
+
* gap. It goes above the list, in place of a row of `Stat` cards.
|
|
31
|
+
*
|
|
32
|
+
* The band is a description list: each figure is read as its label, then its
|
|
33
|
+
* value. The eyebrows are color plus words, never color alone.
|
|
34
|
+
*
|
|
35
|
+
* Below `lg` it stacks: the lead and the callout take a row each and the
|
|
36
|
+
* smaller figures go two by two between them.
|
|
37
|
+
*
|
|
38
|
+
* Outside an `ExpScope` it falls back to a row of core `Stat` cards, with the
|
|
39
|
+
* eyebrow tone as the stat's dot.
|
|
40
|
+
*
|
|
41
|
+
* @component
|
|
42
|
+
* @example
|
|
43
|
+
* <ExpFigureBand
|
|
44
|
+
* lead={{ value: 38, eyebrow: 'Active coverage', label: 'Repos in the whitelist', hint: '27 enabled' }}
|
|
45
|
+
* figures={[
|
|
46
|
+
* { value: 10, label: 'Indexed', hint: 'Ready for a diagnosis' },
|
|
47
|
+
* { value: 28, label: 'Without a clone', hint: 'They wait for a sync' },
|
|
48
|
+
* ]}
|
|
49
|
+
* callout={{ value: 11, eyebrow: 'Gap to close', label: 'Cases without an indexed repo', tone: 'error' }}
|
|
50
|
+
* />
|
|
51
|
+
*
|
|
52
|
+
* @param {ExpFigureBandProps} props - The properties of the ExpFigureBand component.
|
|
53
|
+
* @param {ExpFigureHighlight} props.lead - The main figure, large, at the start.
|
|
54
|
+
* @param {ExpFigure[]} [props.figures] - Smaller figures, in the middle.
|
|
55
|
+
* @param {ExpFigureHighlight} [props.callout] - A figure to act on, large, at the end.
|
|
56
|
+
* @param {boolean} [props.isLoading=false] - Shows placeholders instead of the values.
|
|
57
|
+
*
|
|
58
|
+
* @returns {ReactNode} The band, or a row of core `Stat` cards outside an `ExpScope`.
|
|
59
|
+
*/
|
|
60
|
+
export declare function ExpFigureBand({ lead, figures, callout, isLoading, ...restProps }: ExpFigureBandProps): ReactNode;
|
|
61
|
+
//# sourceMappingURL=ExpFigureBand.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExpFigureBand.d.ts","sourceRoot":"","sources":["../../src/expresivo/ExpFigureBand/ExpFigureBand.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvD,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;AAE3E,MAAM,MAAM,SAAS,GAAG;IACtB,qCAAqC;IACrC,KAAK,EAAE,SAAS,CAAC;IACjB,gCAAgC;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,qCAAqC;IACrC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG;IAC3C,+DAA+D;IAC/D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iFAAiF;IACjF,IAAI,CAAC,EAAE,iBAAiB,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,wDAAwD;IACxD,IAAI,EAAE,kBAAkB,CAAC;IACzB,sCAAsC;IACtC,OAAO,CAAC,EAAE,SAAS,EAAE,CAAC;IACtB,2EAA2E;IAC3E,OAAO,CAAC,EAAE,kBAAkB,CAAC;IAC7B,+DAA+D;IAC/D,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,GAAG,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,UAAU,CAAC,CAAC;AAqElD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,aAAa,CAAC,EAC5B,IAAI,EACJ,OAAY,EACZ,OAAO,EACP,SAAiB,EACjB,GAAG,SAAS,EACb,EAAE,kBAAkB,GAAG,SAAS,CA0FhC"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { Each, Skeleton, Stat } from '@clicoh/orion-library';
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
import { useExpScope } from '../ExpScope/ExpScope';
|
|
5
|
+
// The small eyebrow takes the strong shades: the base error, success and amber
|
|
6
|
+
// sit below 4.5:1 on white at 10px.
|
|
7
|
+
const toneMap = {
|
|
8
|
+
accent: 'text-lavender dark:text-lavender-dark',
|
|
9
|
+
success: 'text-success-strong dark:text-success-dark',
|
|
10
|
+
warning: 'text-amber-strong dark:text-amber-dark',
|
|
11
|
+
error: 'text-error-strong dark:text-error-dark',
|
|
12
|
+
};
|
|
13
|
+
const statTone = {
|
|
14
|
+
accent: 'default',
|
|
15
|
+
success: 'success',
|
|
16
|
+
warning: 'warning',
|
|
17
|
+
error: 'error',
|
|
18
|
+
};
|
|
19
|
+
function Highlight({ figure, tone, side, isLoading, }) {
|
|
20
|
+
return (<div className={clsx('col-span-2 flex min-w-0 items-center', side === 'start'
|
|
21
|
+
? 'flex-row-reverse justify-end gap-5 lg:flex-[1.5] lg:gap-7'
|
|
22
|
+
: 'justify-between gap-5 lg:flex-[1.4]')}>
|
|
23
|
+
<dt className="flex min-w-0 flex-col gap-0.5">
|
|
24
|
+
{!!figure.eyebrow && (<span className={clsx('text-[10px] leading-[14px] font-semibold tracking-[0.04em] uppercase', toneMap[tone])}>
|
|
25
|
+
{figure.eyebrow}
|
|
26
|
+
</span>)}
|
|
27
|
+
<span className="text-[13px] leading-[18px] font-semibold text-black dark:text-white">
|
|
28
|
+
{figure.label}
|
|
29
|
+
</span>
|
|
30
|
+
{!!figure.hint && (<span className="text-gray-1 dark:text-gray-2 text-[11px] leading-4">
|
|
31
|
+
{figure.hint}
|
|
32
|
+
</span>)}
|
|
33
|
+
</dt>
|
|
34
|
+
<dd className="shrink-0 text-5xl leading-none font-bold whitespace-nowrap text-black tabular-nums lg:text-[56px] dark:text-white">
|
|
35
|
+
{isLoading ? (<Skeleton shape="rect" className="h-12 w-16"/>) : (figure.value)}
|
|
36
|
+
</dd>
|
|
37
|
+
</div>);
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* One band with the figures that sum up a list: a large figure at the start,
|
|
41
|
+
* smaller ones in the middle and, at the end, a large one to act on, such as a
|
|
42
|
+
* gap. It goes above the list, in place of a row of `Stat` cards.
|
|
43
|
+
*
|
|
44
|
+
* The band is a description list: each figure is read as its label, then its
|
|
45
|
+
* value. The eyebrows are color plus words, never color alone.
|
|
46
|
+
*
|
|
47
|
+
* Below `lg` it stacks: the lead and the callout take a row each and the
|
|
48
|
+
* smaller figures go two by two between them.
|
|
49
|
+
*
|
|
50
|
+
* Outside an `ExpScope` it falls back to a row of core `Stat` cards, with the
|
|
51
|
+
* eyebrow tone as the stat's dot.
|
|
52
|
+
*
|
|
53
|
+
* @component
|
|
54
|
+
* @example
|
|
55
|
+
* <ExpFigureBand
|
|
56
|
+
* lead={{ value: 38, eyebrow: 'Active coverage', label: 'Repos in the whitelist', hint: '27 enabled' }}
|
|
57
|
+
* figures={[
|
|
58
|
+
* { value: 10, label: 'Indexed', hint: 'Ready for a diagnosis' },
|
|
59
|
+
* { value: 28, label: 'Without a clone', hint: 'They wait for a sync' },
|
|
60
|
+
* ]}
|
|
61
|
+
* callout={{ value: 11, eyebrow: 'Gap to close', label: 'Cases without an indexed repo', tone: 'error' }}
|
|
62
|
+
* />
|
|
63
|
+
*
|
|
64
|
+
* @param {ExpFigureBandProps} props - The properties of the ExpFigureBand component.
|
|
65
|
+
* @param {ExpFigureHighlight} props.lead - The main figure, large, at the start.
|
|
66
|
+
* @param {ExpFigure[]} [props.figures] - Smaller figures, in the middle.
|
|
67
|
+
* @param {ExpFigureHighlight} [props.callout] - A figure to act on, large, at the end.
|
|
68
|
+
* @param {boolean} [props.isLoading=false] - Shows placeholders instead of the values.
|
|
69
|
+
*
|
|
70
|
+
* @returns {ReactNode} The band, or a row of core `Stat` cards outside an `ExpScope`.
|
|
71
|
+
*/
|
|
72
|
+
export function ExpFigureBand({ lead, figures = [], callout, isLoading = false, ...restProps }) {
|
|
73
|
+
const inScope = useExpScope();
|
|
74
|
+
if (!inScope) {
|
|
75
|
+
const stats = [
|
|
76
|
+
{ ...lead, tone: statTone[lead.tone ?? 'accent'] },
|
|
77
|
+
...figures.map((figure) => ({ ...figure, tone: 'default' })),
|
|
78
|
+
...(callout
|
|
79
|
+
? [{ ...callout, tone: statTone[callout.tone ?? 'error'] }]
|
|
80
|
+
: []),
|
|
81
|
+
];
|
|
82
|
+
return (<div {...restProps} aria-busy={isLoading || undefined} className={clsx('grid gap-3 sm:grid-cols-2 lg:auto-cols-fr lg:grid-flow-col lg:grid-cols-none', restProps.className)}>
|
|
83
|
+
<Each of={stats} render={(stat) => (<Stat key={stat.label} label={stat.label} value={stat.value} hint={stat.hint} tone={stat.tone} isLoading={isLoading}/>)}/>
|
|
84
|
+
</div>);
|
|
85
|
+
}
|
|
86
|
+
return (<dl {...restProps} data-orion-part="exp-figure-band" aria-busy={isLoading || undefined} className={clsx('border-gray-5 grid grid-cols-2 gap-x-4 gap-y-6 rounded-2xl border bg-white p-5', 'lg:flex lg:items-center lg:gap-6 lg:px-8 lg:py-7', 'dark:border-gray-1 dark:bg-black', restProps.className)}>
|
|
87
|
+
<Highlight figure={lead} tone={lead.tone ?? 'accent'} side="start" isLoading={isLoading}/>
|
|
88
|
+
<Each of={figures} render={(figure) => (<div key={figure.label} className="grid min-w-0 grid-cols-[auto_minmax(0,1fr)] items-baseline gap-x-3 gap-y-1.5 lg:flex-1">
|
|
89
|
+
<dt className="col-start-2 row-start-1 text-[13px] leading-[18px] font-semibold text-black dark:text-white">
|
|
90
|
+
{figure.label}
|
|
91
|
+
</dt>
|
|
92
|
+
<dd className="col-start-1 row-start-1 text-[32px] leading-none font-bold whitespace-nowrap text-black tabular-nums dark:text-white">
|
|
93
|
+
{isLoading ? (<Skeleton shape="rect" className="h-8 w-10"/>) : (figure.value)}
|
|
94
|
+
</dd>
|
|
95
|
+
{!!figure.hint && (<dd className="text-gray-1 dark:text-gray-2 col-span-2 text-[11px] leading-4">
|
|
96
|
+
{figure.hint}
|
|
97
|
+
</dd>)}
|
|
98
|
+
</div>)}/>
|
|
99
|
+
{!!callout && (<Highlight figure={callout} tone={callout.tone ?? 'error'} side="end" isLoading={isLoading}/>)}
|
|
100
|
+
</dl>);
|
|
101
|
+
}
|
|
102
|
+
//# sourceMappingURL=ExpFigureBand.jsx.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExpFigureBand.jsx","sourceRoot":"","sources":["../../src/expresivo/ExpFigureBand/ExpFigureBand.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AA+BnD,+EAA+E;AAC/E,oCAAoC;AACpC,MAAM,OAAO,GAAsC;IACjD,MAAM,EAAE,uCAAuC;IAC/C,OAAO,EAAE,4CAA4C;IACrD,OAAO,EAAE,wCAAwC;IACjD,KAAK,EAAE,wCAAwC;CAChD,CAAC;AAEF,MAAM,QAAQ,GAAG;IACf,MAAM,EAAE,SAAS;IACjB,OAAO,EAAE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AAC,EAEJ;MAAA,CAAC,CAAC,CAAC,OAAO,IAAI,CACZ,CAAC,SAAS,CACR,MAAM,CAAC,CAAC,OAAO,CAAC,CAChB,IAAI,CAAC,CAAC,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,CAC9B,IAAI,CAAC,KAAK,CACV,SAAS,CAAC,CAAC,SAAS,CAAC,EACrB,CACH,CACH;IAAA,EAAE,EAAE,CAAC,CACN,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/expresivo/ExpFigureBand/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/expresivo/ExpFigureBand/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
|
|
@@ -4,23 +4,34 @@ export type ExpGrowBarProps = {
|
|
|
4
4
|
value: number;
|
|
5
5
|
/** Accessible name of what the bar measures. */
|
|
6
6
|
ariaLabel: string;
|
|
7
|
+
/** Position between 0 and 100 of a tick across the bar, such as an alert threshold. */
|
|
8
|
+
marker?: number;
|
|
7
9
|
} & Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'role'>;
|
|
8
10
|
/**
|
|
9
11
|
* Progress bar whose fill grows in the clicOH gradient when it mounts. For
|
|
10
12
|
* scores and shares shown at rest; for an operation that is still running,
|
|
11
13
|
* use the core `ProgressBar`.
|
|
12
14
|
*
|
|
13
|
-
*
|
|
15
|
+
* A `marker` draws an amber tick across the bar, such as an alert threshold.
|
|
16
|
+
* The tick is decoration: say what it marks in the text next to the bar.
|
|
17
|
+
*
|
|
18
|
+
* Outside an `ExpScope` it falls back to the core `ProgressBar`, without the
|
|
19
|
+
* tick.
|
|
14
20
|
*
|
|
15
21
|
* @component
|
|
16
22
|
* @example
|
|
17
23
|
* <ExpGrowBar value={57} ariaLabel="Share of cases solved" />
|
|
18
24
|
*
|
|
25
|
+
* @example
|
|
26
|
+
* // Budget used, with the alert threshold at 80 %
|
|
27
|
+
* <ExpGrowBar value={35} marker={80} ariaLabel="Budget used" className="h-2.5" />
|
|
28
|
+
*
|
|
19
29
|
* @param {Object} props - The properties of the ExpGrowBar component.
|
|
20
30
|
* @param {number} props.value - Progress between 0 and 100.
|
|
21
31
|
* @param {string} props.ariaLabel - Accessible name of what the bar measures.
|
|
32
|
+
* @param {number} [props.marker] - Position between 0 and 100 of an amber tick across the bar.
|
|
22
33
|
*
|
|
23
34
|
* @returns {ReactNode} The bar, or a core `ProgressBar` outside an `ExpScope`.
|
|
24
35
|
*/
|
|
25
|
-
export declare function ExpGrowBar({ value, ariaLabel, ...restProps }: ExpGrowBarProps): ReactNode;
|
|
36
|
+
export declare function ExpGrowBar({ value, ariaLabel, marker, ...restProps }: ExpGrowBarProps): ReactNode;
|
|
26
37
|
//# sourceMappingURL=ExpGrowBar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpGrowBar.d.ts","sourceRoot":"","sources":["../../src/expresivo/ExpGrowBar/ExpGrowBar.tsx"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,SAAS,EAGf,MAAM,OAAO,CAAC;AAIf,MAAM,MAAM,eAAe,GAAG;IAC5B,kCAAkC;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,gDAAgD;IAChD,SAAS,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"ExpGrowBar.d.ts","sourceRoot":"","sources":["../../src/expresivo/ExpGrowBar/ExpGrowBar.tsx"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,SAAS,EAGf,MAAM,OAAO,CAAC;AAIf,MAAM,MAAM,eAAe,GAAG;IAC5B,kCAAkC;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,gDAAgD;IAChD,SAAS,EAAE,MAAM,CAAC;IAClB,uFAAuF;IACvF,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,GAAG,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,GAAG,MAAM,CAAC,CAAC;AAI9D;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,SAAS,EACT,MAAM,EACN,GAAG,SAAS,EACb,EAAE,eAAe,GAAG,SAAS,CAuC7B"}
|
|
@@ -9,19 +9,28 @@ const clamp = (value) => Math.min(100, Math.max(0, value));
|
|
|
9
9
|
* scores and shares shown at rest; for an operation that is still running,
|
|
10
10
|
* use the core `ProgressBar`.
|
|
11
11
|
*
|
|
12
|
-
*
|
|
12
|
+
* A `marker` draws an amber tick across the bar, such as an alert threshold.
|
|
13
|
+
* The tick is decoration: say what it marks in the text next to the bar.
|
|
14
|
+
*
|
|
15
|
+
* Outside an `ExpScope` it falls back to the core `ProgressBar`, without the
|
|
16
|
+
* tick.
|
|
13
17
|
*
|
|
14
18
|
* @component
|
|
15
19
|
* @example
|
|
16
20
|
* <ExpGrowBar value={57} ariaLabel="Share of cases solved" />
|
|
17
21
|
*
|
|
22
|
+
* @example
|
|
23
|
+
* // Budget used, with the alert threshold at 80 %
|
|
24
|
+
* <ExpGrowBar value={35} marker={80} ariaLabel="Budget used" className="h-2.5" />
|
|
25
|
+
*
|
|
18
26
|
* @param {Object} props - The properties of the ExpGrowBar component.
|
|
19
27
|
* @param {number} props.value - Progress between 0 and 100.
|
|
20
28
|
* @param {string} props.ariaLabel - Accessible name of what the bar measures.
|
|
29
|
+
* @param {number} [props.marker] - Position between 0 and 100 of an amber tick across the bar.
|
|
21
30
|
*
|
|
22
31
|
* @returns {ReactNode} The bar, or a core `ProgressBar` outside an `ExpScope`.
|
|
23
32
|
*/
|
|
24
|
-
export function ExpGrowBar({ value, ariaLabel, ...restProps }) {
|
|
33
|
+
export function ExpGrowBar({ value, ariaLabel, marker, ...restProps }) {
|
|
25
34
|
const inScope = useExpScope();
|
|
26
35
|
const [shown, setShown] = useState(0);
|
|
27
36
|
const percent = clamp(value);
|
|
@@ -32,8 +41,11 @@ export function ExpGrowBar({ value, ariaLabel, ...restProps }) {
|
|
|
32
41
|
if (!inScope) {
|
|
33
42
|
return <ProgressBar {...restProps} value={percent} ariaLabel={ariaLabel}/>;
|
|
34
43
|
}
|
|
35
|
-
return (<div {...restProps} role="progressbar" aria-label={ariaLabel} aria-valuemin={0} aria-valuemax={100} aria-valuenow={percent} className={clsx('
|
|
36
|
-
<span className="
|
|
44
|
+
return (<div {...restProps} role="progressbar" aria-label={ariaLabel} aria-valuemin={0} aria-valuemax={100} aria-valuenow={percent} className={clsx('relative h-2 rounded-full', restProps.className)}>
|
|
45
|
+
<span className="bg-gray-5 dark:bg-gray-dark-1 absolute inset-0 overflow-hidden rounded-full">
|
|
46
|
+
<span className="from-lavender to-violet absolute inset-y-0 left-0 rounded-full bg-linear-90 transition-[width] duration-900 ease-[cubic-bezier(.22,1,.36,1)] motion-reduce:transition-none" style={{ width: `${shown}%` }}/>
|
|
47
|
+
</span>
|
|
48
|
+
{marker !== undefined && (<span aria-hidden="true" className="bg-amber dark:bg-amber-dark absolute -inset-y-1 w-0.5 -translate-x-1/2 rounded-full" style={{ left: `${clamp(marker)}%` }}/>)}
|
|
37
49
|
</div>);
|
|
38
50
|
}
|
|
39
51
|
//# sourceMappingURL=ExpGrowBar.jsx.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpGrowBar.jsx","sourceRoot":"","sources":["../../src/expresivo/ExpGrowBar/ExpGrowBar.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAGL,SAAS,EACT,QAAQ,GACT,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;
|
|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I,SAAS,CAAC,CACd,IAAI,CAAC,aAAa,CAClB,UAAU,CAAC,CAAC,SAAS,CAAC,CACtB,aAAa,CAAC,CAAC,CAAC,CAAC,CACjB,aAAa,CAAC,CAAC,GAAG,CAAC,CACnB,aAAa,CAAC,CAAC,OAAO,CAAC,CACvB,SAAS,CAAC,CAAC,IAAI,CAAC,2BAA2B,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC,CAElE;MAAA,CAAC,IAAI,CAAC,SAAS,CAAC,6EAA6E,CAC3F;QAAA,CAAC,IAAI,CACH,SAAS,CAAC,4KAA4K,CACtL,KAAK,CAAC,CAAC,EAAE,KAAK,EAAE,GAAG,KAAK,GAAG,EAAE,CAAC,EAElC;MAAA,EAAE,IAAI,CACN;MAAA,CAAC,MAAM,KAAK,SAAS,IAAI,CACvB,CAAC,IAAI,CACH,WAAW,CAAC,MAAM,CAClB,SAAS,CAAC,qFAAqF,CAC/F,KAAK,CAAC,CAAC,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,EACrC,CACH,CACH;IAAA,EAAE,GAAG,CAAC,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpJourneyTrack.d.ts","sourceRoot":"","sources":["../../src/expresivo/ExpJourneyTrack/ExpJourneyTrack.tsx"],"names":[],"mappings":"AAGA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,SAAS,
|
|
1
|
+
{"version":3,"file":"ExpJourneyTrack.d.ts","sourceRoot":"","sources":["../../src/expresivo/ExpJourneyTrack/ExpJourneyTrack.tsx"],"names":[],"mappings":"AAGA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,SAAS,EAIf,MAAM,OAAO,CAAC;AAEf,OAAO,EAAuB,KAAK,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC/E,OAAO,EAAa,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AAG7D,MAAM,MAAM,eAAe,GAAG;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,yDAAyD;IACzD,MAAM,EAAE,aAAa,CAAC;IACtB,kEAAkE;IAClE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,yDAAyD;IACzD,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,IAAI,CACtC,YAAY,CAAC,aAAa,CAAC,EAC3B,MAAM,GAAG,SAAS,GAAG,SAAS,CAC/B,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,uBAAuB;IACvB,MAAM,EAAE,eAAe,EAAE,CAAC;IAC1B,kCAAkC;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,mCAAmC;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,sEAAsE;IACtE,WAAW,EAAE,qBAAqB,CAAC;IACnC,iDAAiD;IACjD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mEAAmE;IACnE,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,GAAG,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC,CAAC;AA4CrD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,wBAAgB,eAAe,CAAC,EAC9B,MAAM,EACN,OAAO,EACP,SAAS,EACT,WAAW,EACX,UAAe,EACf,QAAgB,EAChB,GAAG,SAAS,EACb,EAAE,oBAAoB,GAAG,SAAS,CAiMlC"}
|
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import clsx from 'clsx';
|
|
3
|
-
import { useEffect, useState, } from 'react';
|
|
3
|
+
import { useEffect, useState, useSyncExternalStore, } from 'react';
|
|
4
4
|
import { FiCheck } from 'react-icons/fi';
|
|
5
5
|
import { Each, Show, Stepper } from '@clicoh/orion-library';
|
|
6
6
|
import { ExpMascot } from '../ExpMascot';
|
|
7
7
|
import { useExpScopeOptions } from '../ExpScope/ExpScope';
|
|
8
8
|
const STEP_MS = 1100;
|
|
9
|
+
const REDUCED_MOTION_QUERY = '(prefers-reduced-motion: reduce)';
|
|
10
|
+
const subscribeReducedMotion = (onChange) => {
|
|
11
|
+
const query = window.matchMedia(REDUCED_MOTION_QUERY);
|
|
12
|
+
query.addEventListener('change', onChange);
|
|
13
|
+
return () => query.removeEventListener('change', onChange);
|
|
14
|
+
};
|
|
15
|
+
const readReducedMotion = () => window.matchMedia(REDUCED_MOTION_QUERY).matches;
|
|
16
|
+
const readServerReducedMotion = () => false;
|
|
9
17
|
const stateOf = (index, current) => {
|
|
10
18
|
if (index < current)
|
|
11
19
|
return 'done';
|
|
@@ -71,23 +79,29 @@ const alignOf = (index, count) => {
|
|
|
71
79
|
*/
|
|
72
80
|
export function ExpJourneyTrack({ stages, current, ariaLabel, stateLabels, mascotSize = 88, autoplay = false, ...restProps }) {
|
|
73
81
|
const options = useExpScopeOptions();
|
|
74
|
-
const
|
|
82
|
+
const reduceMotion = useSyncExternalStore(subscribeReducedMotion, readReducedMotion, readServerReducedMotion);
|
|
83
|
+
const walks = autoplay && !reduceMotion;
|
|
84
|
+
const walkKey = `${walks}|${current}|${stages.length}`;
|
|
85
|
+
const [walked, setWalked] = useState(0);
|
|
86
|
+
const [walkedFor, setWalkedFor] = useState(walkKey);
|
|
87
|
+
// Every new walk starts again from the first stage.
|
|
88
|
+
if (walkedFor !== walkKey) {
|
|
89
|
+
setWalkedFor(walkKey);
|
|
90
|
+
setWalked(0);
|
|
91
|
+
}
|
|
92
|
+
const step = walks ? walked : current;
|
|
75
93
|
useEffect(() => {
|
|
76
|
-
|
|
77
|
-
if (!autoplay || reduceMotion) {
|
|
78
|
-
setStep(current);
|
|
94
|
+
if (!walks)
|
|
79
95
|
return;
|
|
80
|
-
}
|
|
81
|
-
setStep(0);
|
|
82
96
|
let index = 0;
|
|
83
97
|
const timer = setInterval(() => {
|
|
84
98
|
index += 1;
|
|
85
|
-
|
|
99
|
+
setWalked(Math.min(index, current));
|
|
86
100
|
if (index >= current)
|
|
87
101
|
clearInterval(timer);
|
|
88
102
|
}, STEP_MS);
|
|
89
103
|
return () => clearInterval(timer);
|
|
90
|
-
}, [
|
|
104
|
+
}, [walks, current, stages.length]);
|
|
91
105
|
if (stages.length === 0)
|
|
92
106
|
return null;
|
|
93
107
|
if (!options) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpJourneyTrack.jsx","sourceRoot":"","sources":["../../src/expresivo/ExpJourneyTrack/ExpJourneyTrack.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAIL,SAAS,EACT,QAAQ,
|
|
1
|
+
{"version":3,"file":"ExpJourneyTrack.jsx","sourceRoot":"","sources":["../../src/expresivo/ExpJourneyTrack/ExpJourneyTrack.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAIL,SAAS,EACT,QAAQ,EACR,oBAAoB,GACrB,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAqB,MAAM,uBAAuB,CAAC;AAC/E,OAAO,EAAE,SAAS,EAAsB,MAAM,cAAc,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAmC1D,MAAM,OAAO,GAAG,IAAI,CAAC;AAErB,MAAM,oBAAoB,GAAG,kCAAkC,CAAC;AAEhE,MAAM,sBAAsB,GAAG,CAAC,QAAoB,EAAgB,EAAE;IACpE,MAAM,KAAK,GAAG,MAAM,CAAC,UAAU,CAAC,oBAAoB,CAAC,CAAC;IACtD,KAAK,CAAC,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAC3C,OAAO,GAAG,E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ExpLogo/ExpLogo.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAE,KAAK,WAAW,EAAe,MAAM,WAAW,CAAC;AAE1D,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,WAAW,CAAC;IAClB,6DAA6D;IAC7D,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,OAAO,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,SAAS,EAAE,EAAE,YAAY,GAAG,SAAS,
|
|
1
|
+
{"version":3,"file":"ExpLogo.d.ts","sourceRoot":"","sources":["../../src/expresivo/ExpLogo/ExpLogo.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAE,KAAK,WAAW,EAAe,MAAM,WAAW,CAAC;AAE1D,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,WAAW,CAAC;IAClB,6DAA6D;IAC7D,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,OAAO,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,SAAS,EAAE,EAAE,YAAY,GAAG,SAAS,CAwCzE"}
|
|
@@ -33,9 +33,12 @@ export function ExpLogo({ name, alt, className }) {
|
|
|
33
33
|
const { light, dark, icon } = logoCatalog[name];
|
|
34
34
|
return (<span className={clsx('inline-flex shrink-0 items-center', className)}>
|
|
35
35
|
<span className="hidden lg:block">
|
|
36
|
+
{/* eslint-disable-next-line @next/next/no-img-element -- fixed-size package asset: `next/image` would lazy-load it */}
|
|
36
37
|
<img src={light.src} alt={alt} width={light.width} height={light.height} draggable={false} className="block dark:hidden"/>
|
|
38
|
+
{/* eslint-disable-next-line @next/next/no-img-element -- fixed-size package asset: `next/image` would lazy-load it */}
|
|
37
39
|
<img src={dark.src} alt={alt} width={dark.width} height={dark.height} draggable={false} className="hidden dark:block"/>
|
|
38
40
|
</span>
|
|
41
|
+
{/* eslint-disable-next-line @next/next/no-img-element -- fixed-size package asset: `next/image` would lazy-load it */}
|
|
39
42
|
<img src={icon.src} alt={alt} width={icon.width} height={icon.height} draggable={false} className="block lg:hidden"/>
|
|
40
43
|
</span>);
|
|
41
44
|
}
|