@clicoh/orion-library 1.2.0-beta.11 → 1.2.0-beta.14
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 +919 -0
- package/assets/mascotas/svg/bugi-mascota-01-alerta.svg +39 -0
- package/assets/mascotas/svg/bugi-mascota-02-investigando.svg +36 -0
- package/assets/mascotas/svg/bugi-mascota-05-sorprendido.svg +38 -0
- package/assets/mascotas/svg/oculus-mascota-01-feliz.svg +52 -0
- package/assets/mascotas/svg/oculus-mascota-02-investigando.svg +51 -0
- package/assets/mascotas/svg/oculus-mascota-03-dudando.svg +51 -0
- package/assets/mascotas/svg/oculus-mascota-04-analizando-documento.svg +53 -0
- package/assets/mascotas/svg/oculus-mascota-06-celebrando.svg +54 -0
- package/assets/mascotas/svg/oculus-mascota-07-buscando-rapido.svg +57 -0
- package/assets/mascotas/svg/oculus-mascota-08-satisfecho.svg +55 -0
- package/assets/mascotas/webp/fixi-mascota-01-feliz-sm.webp +0 -0
- package/assets/mascotas/webp/fixi-mascota-02-investigando-sm.webp +0 -0
- package/assets/mascotas/webp/fixi-mascota-03-dudando-sm.webp +0 -0
- package/assets/mascotas/webp/fixi-mascota-04-reparando-sm.webp +0 -0
- package/assets/mascotas/webp/fixi-mascota-05-sorprendido-sm.webp +0 -0
- package/assets/mascotas/webp/fixi-mascota-06-celebrando-sm.webp +0 -0
- package/assets/mascotas/webp/fixi-mascota-07-corriendo-sm.webp +0 -0
- package/dist/components/01-atoms/Button/Button.d.ts +18 -1
- package/dist/components/01-atoms/Button/Button.d.ts.map +1 -1
- package/dist/components/01-atoms/Button/Button.jsx +25 -5
- package/dist/components/01-atoms/Button/Button.jsx.map +1 -1
- package/dist/components/01-atoms/CodeBlock/CodeBlock.d.ts +56 -0
- package/dist/components/01-atoms/CodeBlock/CodeBlock.d.ts.map +1 -0
- package/dist/components/01-atoms/CodeBlock/CodeBlock.jsx +97 -0
- package/dist/components/01-atoms/CodeBlock/CodeBlock.jsx.map +1 -0
- package/dist/components/01-atoms/CodeBlock/index.d.ts +2 -0
- package/dist/components/01-atoms/CodeBlock/index.d.ts.map +1 -0
- package/dist/components/01-atoms/CodeBlock/index.js +2 -0
- package/dist/components/01-atoms/CodeBlock/index.js.map +1 -0
- package/dist/components/01-atoms/Heading/Heading.jsx +1 -1
- package/dist/components/01-atoms/Heading/Heading.jsx.map +1 -1
- package/dist/components/01-atoms/Input/Input.d.ts.map +1 -1
- package/dist/components/01-atoms/Input/Input.jsx +9 -7
- package/dist/components/01-atoms/Input/Input.jsx.map +1 -1
- package/dist/components/01-atoms/Input/utils/RenderErrorOrHelperText.d.ts.map +1 -1
- package/dist/components/01-atoms/Input/utils/RenderErrorOrHelperText.jsx +1 -1
- package/dist/components/01-atoms/Input/utils/RenderErrorOrHelperText.jsx.map +1 -1
- package/dist/components/01-atoms/Select/Select.d.ts.map +1 -1
- package/dist/components/01-atoms/Select/Select.jsx +7 -7
- package/dist/components/01-atoms/Select/Select.jsx.map +1 -1
- package/dist/components/01-atoms/Spinner/Spinner.d.ts +24 -3
- package/dist/components/01-atoms/Spinner/Spinner.d.ts.map +1 -1
- package/dist/components/01-atoms/Spinner/Spinner.jsx +30 -4
- package/dist/components/01-atoms/Spinner/Spinner.jsx.map +1 -1
- package/dist/components/01-atoms/Spinner/index.d.ts +1 -0
- package/dist/components/01-atoms/Spinner/index.d.ts.map +1 -1
- package/dist/components/01-atoms/Stat/Stat.d.ts +47 -0
- package/dist/components/01-atoms/Stat/Stat.d.ts.map +1 -0
- package/dist/components/01-atoms/Stat/Stat.jsx +64 -0
- package/dist/components/01-atoms/Stat/Stat.jsx.map +1 -0
- package/dist/components/01-atoms/Stat/index.d.ts +2 -0
- package/dist/components/01-atoms/Stat/index.d.ts.map +1 -0
- package/dist/components/01-atoms/Stat/index.js +2 -0
- package/dist/components/01-atoms/Stat/index.js.map +1 -0
- package/dist/components/01-atoms/Textarea/Textarea.d.ts.map +1 -1
- package/dist/components/01-atoms/Textarea/Textarea.jsx +3 -3
- package/dist/components/01-atoms/Textarea/Textarea.jsx.map +1 -1
- package/dist/components/01-atoms/index.d.ts +2 -0
- package/dist/components/01-atoms/index.d.ts.map +1 -1
- package/dist/components/01-atoms/index.js +2 -0
- package/dist/components/01-atoms/index.js.map +1 -1
- package/dist/components/02-molecules/Accordion/AccordionSection.d.ts.map +1 -1
- package/dist/components/02-molecules/Accordion/AccordionSection.jsx +26 -3
- package/dist/components/02-molecules/Accordion/AccordionSection.jsx.map +1 -1
- package/dist/components/02-molecules/Card/Card.d.ts +74 -0
- package/dist/components/02-molecules/Card/Card.d.ts.map +1 -0
- package/dist/components/02-molecules/Card/Card.jsx +83 -0
- package/dist/components/02-molecules/Card/Card.jsx.map +1 -0
- package/dist/components/02-molecules/Card/index.d.ts +2 -0
- package/dist/components/02-molecules/Card/index.d.ts.map +1 -0
- package/dist/components/02-molecules/Card/index.js +2 -0
- package/dist/components/02-molecules/Card/index.js.map +1 -0
- package/dist/components/02-molecules/DatePicker/DatePicker.d.ts +37 -2
- package/dist/components/02-molecules/DatePicker/DatePicker.d.ts.map +1 -1
- package/dist/components/02-molecules/DatePicker/DatePicker.jsx +187 -32
- package/dist/components/02-molecules/DatePicker/DatePicker.jsx.map +1 -1
- package/dist/components/02-molecules/EmptyState/EmptyState.d.ts +52 -0
- package/dist/components/02-molecules/EmptyState/EmptyState.d.ts.map +1 -0
- package/dist/components/02-molecules/EmptyState/EmptyState.jsx +66 -0
- package/dist/components/02-molecules/EmptyState/EmptyState.jsx.map +1 -0
- package/dist/components/02-molecules/EmptyState/index.d.ts +2 -0
- package/dist/components/02-molecules/EmptyState/index.d.ts.map +1 -0
- package/dist/components/02-molecules/EmptyState/index.js +2 -0
- package/dist/components/02-molecules/EmptyState/index.js.map +1 -0
- package/dist/components/02-molecules/Filter/Filter.d.ts +7 -1
- package/dist/components/02-molecules/Filter/Filter.d.ts.map +1 -1
- package/dist/components/02-molecules/Filter/Filter.jsx +10 -7
- package/dist/components/02-molecules/Filter/Filter.jsx.map +1 -1
- package/dist/components/02-molecules/InlineMessage/InlineMessage.d.ts +15 -1
- package/dist/components/02-molecules/InlineMessage/InlineMessage.d.ts.map +1 -1
- package/dist/components/02-molecules/InlineMessage/InlineMessage.jsx +18 -3
- package/dist/components/02-molecules/InlineMessage/InlineMessage.jsx.map +1 -1
- package/dist/components/02-molecules/Menu/MenuItem.d.ts.map +1 -1
- package/dist/components/02-molecules/Menu/MenuItem.jsx +2 -2
- package/dist/components/02-molecules/Menu/MenuItem.jsx.map +1 -1
- package/dist/components/02-molecules/Menu/MenuList.d.ts.map +1 -1
- package/dist/components/02-molecules/Menu/MenuList.jsx +1 -1
- package/dist/components/02-molecules/Menu/MenuList.jsx.map +1 -1
- package/dist/components/02-molecules/Stepper/Stepper.d.ts +70 -0
- package/dist/components/02-molecules/Stepper/Stepper.d.ts.map +1 -0
- package/dist/components/02-molecules/Stepper/Stepper.jsx +204 -0
- package/dist/components/02-molecules/Stepper/Stepper.jsx.map +1 -0
- package/dist/components/02-molecules/Stepper/index.d.ts +2 -0
- package/dist/components/02-molecules/Stepper/index.d.ts.map +1 -0
- package/dist/components/02-molecules/Stepper/index.js +2 -0
- package/dist/components/02-molecules/Stepper/index.js.map +1 -0
- package/dist/components/02-molecules/Table/Table.d.ts +3 -1
- package/dist/components/02-molecules/Table/Table.d.ts.map +1 -1
- package/dist/components/02-molecules/Table/Table.jsx +6 -5
- package/dist/components/02-molecules/Table/Table.jsx.map +1 -1
- package/dist/components/02-molecules/Timeline/Timeline.d.ts +47 -0
- package/dist/components/02-molecules/Timeline/Timeline.d.ts.map +1 -0
- package/dist/components/02-molecules/Timeline/Timeline.jsx +65 -0
- package/dist/components/02-molecules/Timeline/Timeline.jsx.map +1 -0
- package/dist/components/02-molecules/Timeline/index.d.ts +2 -0
- package/dist/components/02-molecules/Timeline/index.d.ts.map +1 -0
- package/dist/components/02-molecules/Timeline/index.js +2 -0
- package/dist/components/02-molecules/Timeline/index.js.map +1 -0
- package/dist/components/02-molecules/index.d.ts +4 -0
- package/dist/components/02-molecules/index.d.ts.map +1 -1
- package/dist/components/02-molecules/index.js +4 -0
- package/dist/components/02-molecules/index.js.map +1 -1
- package/dist/components/03-organisms/DataTable/DataTable.d.ts +1 -1
- package/dist/components/03-organisms/DataTable/DataTable.d.ts.map +1 -1
- package/dist/components/03-organisms/DataTable/DataTable.jsx.map +1 -1
- package/dist/components/03-organisms/Header/Header.d.ts +3 -1
- package/dist/components/03-organisms/Header/Header.d.ts.map +1 -1
- package/dist/components/03-organisms/Header/Header.jsx +4 -5
- package/dist/components/03-organisms/Header/Header.jsx.map +1 -1
- package/dist/components/04-templates/DashboardTemplate/DashboardTemplate.d.ts +36 -4
- package/dist/components/04-templates/DashboardTemplate/DashboardTemplate.d.ts.map +1 -1
- package/dist/components/04-templates/DashboardTemplate/DashboardTemplate.jsx +44 -10
- package/dist/components/04-templates/DashboardTemplate/DashboardTemplate.jsx.map +1 -1
- package/dist/components/04-templates/DashboardTemplate/HeadingWithTitle.d.ts +6 -2
- package/dist/components/04-templates/DashboardTemplate/HeadingWithTitle.d.ts.map +1 -1
- package/dist/components/04-templates/DashboardTemplate/HeadingWithTitle.jsx +7 -3
- package/dist/components/04-templates/DashboardTemplate/HeadingWithTitle.jsx.map +1 -1
- package/dist/components/04-templates/LoginTemplate/LoginTemplate.d.ts +2 -0
- package/dist/components/04-templates/LoginTemplate/LoginTemplate.d.ts.map +1 -1
- package/dist/components/04-templates/LoginTemplate/LoginTemplate.jsx +2 -1
- package/dist/components/04-templates/LoginTemplate/LoginTemplate.jsx.map +1 -1
- package/expresivo/ExpBubble/ExpBubble.d.ts +51 -0
- package/expresivo/ExpBubble/ExpBubble.d.ts.map +1 -0
- package/expresivo/ExpBubble/ExpBubble.jsx +74 -0
- package/expresivo/ExpBubble/ExpBubble.jsx.map +1 -0
- package/expresivo/ExpBubble/index.d.ts +3 -0
- package/expresivo/ExpBubble/index.d.ts.map +1 -0
- package/expresivo/ExpBubble/index.js +2 -0
- package/expresivo/ExpBubble/index.js.map +1 -0
- package/expresivo/ExpCollapseToggle/ExpCollapseToggle.d.ts +37 -0
- package/expresivo/ExpCollapseToggle/ExpCollapseToggle.d.ts.map +1 -0
- package/expresivo/ExpCollapseToggle/ExpCollapseToggle.jsx +43 -0
- package/expresivo/ExpCollapseToggle/ExpCollapseToggle.jsx.map +1 -0
- package/expresivo/ExpCollapseToggle/index.d.ts +3 -0
- package/expresivo/ExpCollapseToggle/index.d.ts.map +1 -0
- package/expresivo/ExpCollapseToggle/index.js +2 -0
- package/expresivo/ExpCollapseToggle/index.js.map +1 -0
- package/expresivo/ExpGrowBar/ExpGrowBar.d.ts +26 -0
- package/expresivo/ExpGrowBar/ExpGrowBar.d.ts.map +1 -0
- package/expresivo/ExpGrowBar/ExpGrowBar.jsx +39 -0
- package/expresivo/ExpGrowBar/ExpGrowBar.jsx.map +1 -0
- package/expresivo/ExpGrowBar/index.d.ts +3 -0
- package/expresivo/ExpGrowBar/index.d.ts.map +1 -0
- package/expresivo/ExpGrowBar/index.js +2 -0
- package/expresivo/ExpGrowBar/index.js.map +1 -0
- package/expresivo/ExpJourneyTrack/ExpJourneyTrack.d.ts +65 -0
- package/expresivo/ExpJourneyTrack/ExpJourneyTrack.d.ts.map +1 -0
- package/expresivo/ExpJourneyTrack/ExpJourneyTrack.jsx +156 -0
- package/expresivo/ExpJourneyTrack/ExpJourneyTrack.jsx.map +1 -0
- package/expresivo/ExpJourneyTrack/index.d.ts +3 -0
- package/expresivo/ExpJourneyTrack/index.d.ts.map +1 -0
- package/expresivo/ExpJourneyTrack/index.js +2 -0
- package/expresivo/ExpJourneyTrack/index.js.map +1 -0
- package/expresivo/ExpKeyButton/ExpKeyButton.d.ts +49 -0
- package/expresivo/ExpKeyButton/ExpKeyButton.d.ts.map +1 -0
- package/expresivo/ExpKeyButton/ExpKeyButton.jsx +60 -0
- package/expresivo/ExpKeyButton/ExpKeyButton.jsx.map +1 -0
- package/expresivo/ExpKeyButton/index.d.ts +3 -0
- package/expresivo/ExpKeyButton/index.d.ts.map +1 -0
- package/expresivo/ExpKeyButton/index.js +2 -0
- package/expresivo/ExpKeyButton/index.js.map +1 -0
- package/expresivo/ExpLensIcon/ExpLensIcon.d.ts +29 -0
- package/expresivo/ExpLensIcon/ExpLensIcon.d.ts.map +1 -0
- package/expresivo/ExpLensIcon/ExpLensIcon.jsx +29 -0
- package/expresivo/ExpLensIcon/ExpLensIcon.jsx.map +1 -0
- package/expresivo/ExpLensIcon/index.d.ts +3 -0
- package/expresivo/ExpLensIcon/index.d.ts.map +1 -0
- package/expresivo/ExpLensIcon/index.js +2 -0
- package/expresivo/ExpLensIcon/index.js.map +1 -0
- package/expresivo/ExpMascot/ExpMascot.d.ts +41 -0
- package/expresivo/ExpMascot/ExpMascot.d.ts.map +1 -0
- package/expresivo/ExpMascot/ExpMascot.jsx +45 -0
- package/expresivo/ExpMascot/ExpMascot.jsx.map +1 -0
- package/expresivo/ExpMascot/catalog.d.ts +12 -0
- package/expresivo/ExpMascot/catalog.d.ts.map +1 -0
- package/expresivo/ExpMascot/catalog.js +41 -0
- package/expresivo/ExpMascot/catalog.js.map +1 -0
- package/expresivo/ExpMascot/index.d.ts +4 -0
- package/expresivo/ExpMascot/index.d.ts.map +1 -0
- package/expresivo/ExpMascot/index.js +2 -0
- package/expresivo/ExpMascot/index.js.map +1 -0
- package/expresivo/ExpMedalBadge/ExpMedalBadge.d.ts +29 -0
- package/expresivo/ExpMedalBadge/ExpMedalBadge.d.ts.map +1 -0
- package/expresivo/ExpMedalBadge/ExpMedalBadge.jsx +87 -0
- package/expresivo/ExpMedalBadge/ExpMedalBadge.jsx.map +1 -0
- package/expresivo/ExpMedalBadge/index.d.ts +3 -0
- package/expresivo/ExpMedalBadge/index.d.ts.map +1 -0
- package/expresivo/ExpMedalBadge/index.js +2 -0
- package/expresivo/ExpMedalBadge/index.js.map +1 -0
- package/expresivo/ExpPageHero/ExpPageHero.d.ts +82 -0
- package/expresivo/ExpPageHero/ExpPageHero.d.ts.map +1 -0
- package/expresivo/ExpPageHero/ExpPageHero.jsx +113 -0
- package/expresivo/ExpPageHero/ExpPageHero.jsx.map +1 -0
- package/expresivo/ExpPageHero/index.d.ts +3 -0
- package/expresivo/ExpPageHero/index.d.ts.map +1 -0
- package/expresivo/ExpPageHero/index.js +2 -0
- package/expresivo/ExpPageHero/index.js.map +1 -0
- package/expresivo/ExpPillButton/ExpPillButton.d.ts +44 -0
- package/expresivo/ExpPillButton/ExpPillButton.d.ts.map +1 -0
- package/expresivo/ExpPillButton/ExpPillButton.jsx +75 -0
- package/expresivo/ExpPillButton/ExpPillButton.jsx.map +1 -0
- package/expresivo/ExpPillButton/index.d.ts +3 -0
- package/expresivo/ExpPillButton/index.d.ts.map +1 -0
- package/expresivo/ExpPillButton/index.js +2 -0
- package/expresivo/ExpPillButton/index.js.map +1 -0
- package/expresivo/ExpScope/ExpScope.d.ts +63 -0
- package/expresivo/ExpScope/ExpScope.d.ts.map +1 -0
- package/expresivo/ExpScope/ExpScope.jsx +67 -0
- package/expresivo/ExpScope/ExpScope.jsx.map +1 -0
- package/expresivo/ExpScope/index.d.ts +3 -0
- package/expresivo/ExpScope/index.d.ts.map +1 -0
- package/expresivo/ExpScope/index.js +2 -0
- package/expresivo/ExpScope/index.js.map +1 -0
- package/expresivo/ExpScoreRing/ExpScoreRing.d.ts +35 -0
- package/expresivo/ExpScoreRing/ExpScoreRing.d.ts.map +1 -0
- package/expresivo/ExpScoreRing/ExpScoreRing.jsx +67 -0
- package/expresivo/ExpScoreRing/ExpScoreRing.jsx.map +1 -0
- package/expresivo/ExpScoreRing/index.d.ts +3 -0
- package/expresivo/ExpScoreRing/index.d.ts.map +1 -0
- package/expresivo/ExpScoreRing/index.js +2 -0
- package/expresivo/ExpScoreRing/index.js.map +1 -0
- package/expresivo/index.d.ts +13 -0
- package/expresivo/index.d.ts.map +1 -0
- package/expresivo/index.js +13 -0
- package/expresivo/index.js.map +1 -0
- package/expresivo/shared/glyphs.d.ts +20 -0
- package/expresivo/shared/glyphs.d.ts.map +1 -0
- package/expresivo/shared/glyphs.jsx +60 -0
- package/expresivo/shared/glyphs.jsx.map +1 -0
- package/package.json +3 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExpMedalBadge.d.ts","sourceRoot":"","sources":["../../src/expresivo/ExpMedalBadge/ExpMedalBadge.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvD,MAAM,MAAM,qBAAqB,GAC7B,SAAS,GACT,SAAS,GACT,OAAO,GACP,MAAM,GACN,UAAU,GACV,UAAU,CAAC;AAEf,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,EAAE,qBAAqB,CAAC;IAChC,qDAAqD;IACrD,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,QAAQ,EAAE,SAAS,CAAC;CACrB,GAAG,IAAI,CAAC,cAAc,CAAC,eAAe,CAAC,EAAE,UAAU,CAAC,CAAC;AAgDtD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,KAAW,EACX,QAAQ,EACR,GAAG,SAAS,EACb,EAAE,kBAAkB,GAAG,SAAS,CAkDhC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import { Badge } from '@clicoh/orion-library';
|
|
4
|
+
import { useExpScope } from '../ExpScope/ExpScope';
|
|
5
|
+
// The ribbon and the pill label use the strong shade: the base `warning`
|
|
6
|
+
// and `success` hues sit below 4.5:1 on their tint.
|
|
7
|
+
const colorMap = {
|
|
8
|
+
success: {
|
|
9
|
+
ring: 'bg-success',
|
|
10
|
+
ribbon: 'bg-success-strong',
|
|
11
|
+
pill: 'border-success bg-success-1 text-success-strong dark:bg-success/16 dark:text-success',
|
|
12
|
+
},
|
|
13
|
+
warning: {
|
|
14
|
+
ring: 'bg-amber',
|
|
15
|
+
ribbon: 'bg-amber-strong',
|
|
16
|
+
pill: 'border-amber bg-warning-1 text-amber-strong dark:bg-warning/16 dark:text-amber',
|
|
17
|
+
},
|
|
18
|
+
error: {
|
|
19
|
+
ring: 'bg-error',
|
|
20
|
+
ribbon: 'bg-error-strong',
|
|
21
|
+
pill: 'border-error bg-error-1 text-error-strong dark:bg-error/16 dark:text-error',
|
|
22
|
+
},
|
|
23
|
+
info: {
|
|
24
|
+
ring: 'bg-info',
|
|
25
|
+
ribbon: 'bg-info-dark-3 dark:bg-info',
|
|
26
|
+
pill: 'border-info bg-info-1 text-info-dark-3 dark:bg-info/16 dark:text-info',
|
|
27
|
+
},
|
|
28
|
+
progress: {
|
|
29
|
+
ring: 'bg-lavender',
|
|
30
|
+
ribbon: 'bg-lavender',
|
|
31
|
+
pill: 'border-lavender bg-lavender-2 text-lavender dark:bg-lavender/18 dark:text-lavender',
|
|
32
|
+
},
|
|
33
|
+
disabled: {
|
|
34
|
+
ring: 'bg-gray-1',
|
|
35
|
+
ribbon: 'bg-gray-1',
|
|
36
|
+
pill: 'border-gray-1 bg-gray-6 text-gray-1 dark:bg-gray-2/16 dark:text-gray-2',
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
const glyphColorMap = {
|
|
40
|
+
success: 'text-success',
|
|
41
|
+
warning: 'text-amber',
|
|
42
|
+
error: 'text-error',
|
|
43
|
+
info: 'text-info',
|
|
44
|
+
progress: 'text-lavender',
|
|
45
|
+
disabled: 'text-gray-1 dark:text-gray-2',
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Status badge drawn as an octagonal medal with a ribbon, pinned to a tinted
|
|
49
|
+
* pill. Same status modifiers as the core `Badge`; the label carries the
|
|
50
|
+
* message and the medal only decorates it.
|
|
51
|
+
*
|
|
52
|
+
* Outside an `ExpScope` it falls back to the core `Badge` with the same
|
|
53
|
+
* `modifier`.
|
|
54
|
+
*
|
|
55
|
+
* @component
|
|
56
|
+
* @example
|
|
57
|
+
* <ExpMedalBadge modifier="success" glyph="✓">Passed</ExpMedalBadge>
|
|
58
|
+
*
|
|
59
|
+
* @param {Object} props - The properties of the ExpMedalBadge component.
|
|
60
|
+
* @param {'success' | 'warning' | 'error' | 'info' | 'progress' | 'disabled'} props.modifier - Status color.
|
|
61
|
+
* @param {ReactNode} [props.glyph='•'] - One character or a tiny icon inside the medal.
|
|
62
|
+
* @param {ReactNode} props.children - Label of the status.
|
|
63
|
+
*
|
|
64
|
+
* @returns {ReactNode} The medal badge, or a core `Badge` outside an `ExpScope`.
|
|
65
|
+
*/
|
|
66
|
+
export function ExpMedalBadge({ modifier, glyph = '•', children, ...restProps }) {
|
|
67
|
+
const inScope = useExpScope();
|
|
68
|
+
if (!inScope) {
|
|
69
|
+
return (<Badge {...restProps} modifier={modifier}>
|
|
70
|
+
{children}
|
|
71
|
+
</Badge>);
|
|
72
|
+
}
|
|
73
|
+
const colors = colorMap[modifier];
|
|
74
|
+
return (<span {...restProps} className={clsx('relative inline-flex h-[22px] items-center pl-2.5 whitespace-nowrap', restProps.className)}>
|
|
75
|
+
<span className={clsx('inline-flex h-[18px] items-center rounded-full border pr-2 pl-3.5 text-[11px] leading-4 font-semibold', colors.pill)}>
|
|
76
|
+
{children}
|
|
77
|
+
</span>
|
|
78
|
+
<span aria-hidden="true" className="absolute top-px left-0 size-5">
|
|
79
|
+
<span className={clsx('exp-medal-ribbon absolute top-3 left-[5px] h-[11px] w-2.5', colors.ribbon)}/>
|
|
80
|
+
<span className={clsx('exp-medal-octagon absolute inset-0', colors.ring)}/>
|
|
81
|
+
<span className={clsx('exp-medal-octagon absolute inset-0.5 flex items-center justify-center bg-white text-[10px] leading-none font-extrabold dark:bg-black', glyphColorMap[modifier])}>
|
|
82
|
+
{glyph}
|
|
83
|
+
</span>
|
|
84
|
+
</span>
|
|
85
|
+
</span>);
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=ExpMed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/expresivo/ExpMedalBadge/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EACV,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/expresivo/ExpMedalBadge/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
import type { ExpMascotName } from '../ExpMascot/catalog';
|
|
3
|
+
export type ExpPageHeroLevel = 'h3' | 'h4' | 'h5';
|
|
4
|
+
export type ExpPageHeroBubble = {
|
|
5
|
+
title?: ReactNode;
|
|
6
|
+
text?: ReactNode;
|
|
7
|
+
badge?: ReactNode;
|
|
8
|
+
};
|
|
9
|
+
export type ExpPageHeroCollapse = {
|
|
10
|
+
collapsed: boolean;
|
|
11
|
+
onToggle: () => void;
|
|
12
|
+
/** Accessible name while collapsed, such as "Expand header". */
|
|
13
|
+
expandLabel: string;
|
|
14
|
+
/** Accessible name while expanded, such as "Collapse header". */
|
|
15
|
+
collapseLabel: string;
|
|
16
|
+
};
|
|
17
|
+
export type ExpPageHeroProps = {
|
|
18
|
+
title: ReactNode;
|
|
19
|
+
eyebrow?: ReactNode;
|
|
20
|
+
headingLevel?: ExpPageHeroLevel;
|
|
21
|
+
titleAdornment?: ReactNode;
|
|
22
|
+
description?: ReactNode;
|
|
23
|
+
/** Content under the description, such as stat chips or a data line. */
|
|
24
|
+
children?: ReactNode;
|
|
25
|
+
actions?: ReactNode;
|
|
26
|
+
mascot?: ExpMascotName;
|
|
27
|
+
bubble?: ExpPageHeroBubble;
|
|
28
|
+
collapse?: ExpPageHeroCollapse;
|
|
29
|
+
} & Omit<HTMLAttributes<HTMLDivElement>, 'title' | 'children'>;
|
|
30
|
+
/**
|
|
31
|
+
* Page header for the top of a screen, meant for the `heading` slot of
|
|
32
|
+
* `DashboardTemplate`: an eyebrow, the title, a description, optional content
|
|
33
|
+
* under it, and a mascot with a speech bubble on the right.
|
|
34
|
+
*
|
|
35
|
+
* On wide screens it draws a band with a dotted lavender background. With
|
|
36
|
+
* `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 is
|
|
38
|
+
* a plain title row without eyebrow, mascot or bubble, and `collapse` has no
|
|
39
|
+
* effect.
|
|
40
|
+
*
|
|
41
|
+
* Outside an `ExpScope` it renders the core title row of `DashboardTemplate`:
|
|
42
|
+
* title, adornment, description, children and actions.
|
|
43
|
+
*
|
|
44
|
+
* @component
|
|
45
|
+
* @example
|
|
46
|
+
* <ExpPageHero
|
|
47
|
+
* eyebrow="Case memory"
|
|
48
|
+
* title="Cases"
|
|
49
|
+
* description="Review past diagnoses before starting from scratch."
|
|
50
|
+
* mascot="fixi-02-investigando"
|
|
51
|
+
* bubble={{ title: 'Lead found', text: 'Search by ticket or symptom.' }}
|
|
52
|
+
* />
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* // Collapsible, with the state kept by the consumer
|
|
56
|
+
* <ExpPageHero
|
|
57
|
+
* title="Cases"
|
|
58
|
+
* mascot="fixi-02-investigando"
|
|
59
|
+
* collapse={{
|
|
60
|
+
* collapsed,
|
|
61
|
+
* onToggle: () => setCollapsed(!collapsed),
|
|
62
|
+
* expandLabel: 'Expand header',
|
|
63
|
+
* collapseLabel: 'Collapse header',
|
|
64
|
+
* }}
|
|
65
|
+
* />
|
|
66
|
+
*
|
|
67
|
+
* @param {Object} props - The properties of the ExpPageHero component.
|
|
68
|
+
* @param {ReactNode} props.title - Page title.
|
|
69
|
+
* @param {ReactNode} [props.eyebrow] - Short uppercase line above the title, only on wide screens.
|
|
70
|
+
* @param {'h3' | 'h4' | 'h5'} [props.headingLevel='h3'] - Heading level of the title.
|
|
71
|
+
* @param {ReactNode} [props.titleAdornment] - Content next to the title, such as a `Badge`.
|
|
72
|
+
* @param {ReactNode} [props.description] - Text under the title; hidden while collapsed.
|
|
73
|
+
* @param {ReactNode} [props.children] - Content under the description, such as stat chips; hidden while collapsed.
|
|
74
|
+
* @param {ReactNode} [props.actions] - Content on the right, such as buttons; it moves under the title on small screens.
|
|
75
|
+
* @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 `badge`.
|
|
77
|
+
* @param {ExpPageHeroCollapse} [props.collapse] - Makes the header collapsible: `collapsed`, `onToggle`, `expandLabel` and `collapseLabel`.
|
|
78
|
+
*
|
|
79
|
+
* @returns {ReactNode} The page header.
|
|
80
|
+
*/
|
|
81
|
+
export declare function ExpPageHero({ title, eyebrow, headingLevel, titleAdornment, description, children, actions, mascot, bubble, collapse, ...restProps }: ExpPageHeroProps): ReactNode;
|
|
82
|
+
//# sourceMappingURL=ExpPageHero.d.ts.map
|
|
@@ -0,0 +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;IACjB,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,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;CAChC,GAAG,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC,CAAC;AAE/D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;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,GAAG,SAAS,EACb,EAAE,gBAAgB,GAAG,SAAS,CAmH9B"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import { useId } from 'react';
|
|
4
|
+
import { Heading } from '@clicoh/orion-library';
|
|
5
|
+
import { ExpBubble } from '../ExpBubble/ExpBubble';
|
|
6
|
+
import { ExpCollapseToggle } from '../ExpCollapseToggle/ExpCollapseToggle';
|
|
7
|
+
import { ExpMascot } from '../ExpMascot/ExpMascot';
|
|
8
|
+
import { useExpScopeOptions } from '../ExpScope/ExpScope';
|
|
9
|
+
/**
|
|
10
|
+
* Page header for the top of a screen, meant for the `heading` slot of
|
|
11
|
+
* `DashboardTemplate`: an eyebrow, the title, a description, optional content
|
|
12
|
+
* under it, and a mascot with a speech bubble on the right.
|
|
13
|
+
*
|
|
14
|
+
* On wide screens it draws a band with a dotted lavender background. With
|
|
15
|
+
* `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 is
|
|
17
|
+
* a plain title row without eyebrow, mascot or bubble, and `collapse` has no
|
|
18
|
+
* effect.
|
|
19
|
+
*
|
|
20
|
+
* Outside an `ExpScope` it renders the core title row of `DashboardTemplate`:
|
|
21
|
+
* title, adornment, description, children and actions.
|
|
22
|
+
*
|
|
23
|
+
* @component
|
|
24
|
+
* @example
|
|
25
|
+
* <ExpPageHero
|
|
26
|
+
* eyebrow="Case memory"
|
|
27
|
+
* title="Cases"
|
|
28
|
+
* description="Review past diagnoses before starting from scratch."
|
|
29
|
+
* mascot="fixi-02-investigando"
|
|
30
|
+
* bubble={{ title: 'Lead found', text: 'Search by ticket or symptom.' }}
|
|
31
|
+
* />
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* // Collapsible, with the state kept by the consumer
|
|
35
|
+
* <ExpPageHero
|
|
36
|
+
* title="Cases"
|
|
37
|
+
* mascot="fixi-02-investigando"
|
|
38
|
+
* collapse={{
|
|
39
|
+
* collapsed,
|
|
40
|
+
* onToggle: () => setCollapsed(!collapsed),
|
|
41
|
+
* expandLabel: 'Expand header',
|
|
42
|
+
* collapseLabel: 'Collapse header',
|
|
43
|
+
* }}
|
|
44
|
+
* />
|
|
45
|
+
*
|
|
46
|
+
* @param {Object} props - The properties of the ExpPageHero component.
|
|
47
|
+
* @param {ReactNode} props.title - Page title.
|
|
48
|
+
* @param {ReactNode} [props.eyebrow] - Short uppercase line above the title, only on wide screens.
|
|
49
|
+
* @param {'h3' | 'h4' | 'h5'} [props.headingLevel='h3'] - Heading level of the title.
|
|
50
|
+
* @param {ReactNode} [props.titleAdornment] - Content next to the title, such as a `Badge`.
|
|
51
|
+
* @param {ReactNode} [props.description] - Text under the title; hidden while collapsed.
|
|
52
|
+
* @param {ReactNode} [props.children] - Content under the description, such as stat chips; hidden while collapsed.
|
|
53
|
+
* @param {ReactNode} [props.actions] - Content on the right, such as buttons; it moves under the title on small screens.
|
|
54
|
+
* @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 `badge`.
|
|
56
|
+
* @param {ExpPageHeroCollapse} [props.collapse] - Makes the header collapsible: `collapsed`, `onToggle`, `expandLabel` and `collapseLabel`.
|
|
57
|
+
*
|
|
58
|
+
* @returns {ReactNode} The page header.
|
|
59
|
+
*/
|
|
60
|
+
export function ExpPageHero({ title, eyebrow, headingLevel = 'h3', titleAdornment, description, children, actions, mascot, bubble, collapse, ...restProps }) {
|
|
61
|
+
const options = useExpScopeOptions();
|
|
62
|
+
const generatedId = useId();
|
|
63
|
+
const id = restProps.id ?? generatedId;
|
|
64
|
+
const collapsed = !!collapse?.collapsed;
|
|
65
|
+
const hasAside = !!mascot || !!bubble;
|
|
66
|
+
const titleRow = (<div className="flex min-w-0 flex-wrap items-center gap-x-3 gap-y-1">
|
|
67
|
+
<Heading level={headingLevel}>{title}</Heading>
|
|
68
|
+
{titleAdornment}
|
|
69
|
+
</div>);
|
|
70
|
+
if (!options) {
|
|
71
|
+
return (<div {...restProps} className={clsx('flex flex-col items-start gap-3 sm:flex-row sm:justify-between', restProps.className)}>
|
|
72
|
+
<div className="flex min-w-0 flex-col gap-1">
|
|
73
|
+
{titleRow}
|
|
74
|
+
{!!description && (<div className="text-gray-1 dark:text-gray-2 text-sm">
|
|
75
|
+
{description}
|
|
76
|
+
</div>)}
|
|
77
|
+
{children}
|
|
78
|
+
</div>
|
|
79
|
+
{actions}
|
|
80
|
+
</div>);
|
|
81
|
+
}
|
|
82
|
+
return (<div {...restProps} id={id} data-state={collapsed ? 'collapsed' : 'expanded'} className={clsx('exp-hero relative flex flex-col items-start gap-3 sm:flex-row sm:items-center sm:justify-between lg:gap-6', collapsed
|
|
83
|
+
? 'lg:min-h-[72px] lg:py-3.5 lg:pr-30 lg:pl-6'
|
|
84
|
+
: 'lg:px-8 lg:py-6', !collapsed && !!collapse && !hasAside && 'lg:pr-20', restProps.className)}>
|
|
85
|
+
<div className="flex min-w-0 flex-col items-start gap-1 lg:flex-[1_1_420px]">
|
|
86
|
+
{!!eyebrow && (<p className={clsx('text-lavender dark:text-lavender-dark hidden text-xs leading-4 font-semibold tracking-[0.04em] uppercase', !collapsed && 'lg:block')}>
|
|
87
|
+
<span aria-hidden="true">✦ </span>
|
|
88
|
+
{eyebrow}
|
|
89
|
+
</p>)}
|
|
90
|
+
{titleRow}
|
|
91
|
+
{!!description && (<div className={clsx('text-gray-1 dark:text-gray-2 max-w-[680px] text-sm leading-[22px] text-pretty', collapsed && 'lg:hidden')}>
|
|
92
|
+
{description}
|
|
93
|
+
</div>)}
|
|
94
|
+
{!!children && (<div className={clsx('mt-2 w-full', collapsed && 'lg:hidden')}>
|
|
95
|
+
{children}
|
|
96
|
+
</div>)}
|
|
97
|
+
</div>
|
|
98
|
+
{actions}
|
|
99
|
+
{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}>
|
|
101
|
+
{bubble.text}
|
|
102
|
+
</ExpBubble>)}
|
|
103
|
+
{!!mascot && <ExpMascot name={mascot} size={104}/>}
|
|
104
|
+
</div>)}
|
|
105
|
+
{collapsed && !!mascot && (<span className="absolute top-0 right-18 hidden lg:block">
|
|
106
|
+
<ExpMascot name={mascot} size={56} motion="hang"/>
|
|
107
|
+
</span>)}
|
|
108
|
+
{!!collapse && (<div className="absolute top-5 right-5 hidden lg:block">
|
|
109
|
+
<ExpCollapseToggle collapsed={collapsed} onToggle={collapse.onToggle} expandLabel={collapse.expandLabel} collapseLabel={collapse.collapseLabel} aria-controls={id}/>
|
|
110
|
+
</div>)}
|
|
111
|
+
</div>);
|
|
112
|
+
}
|
|
113
|
+
//# sourceMappingURL=ExpPageHero.jsx.map
|
|
@@ -0,0 +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;AAiC1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AACH,MAAM,UAAU,WAAW,CAAC,EAC1B,KAAK,EACL,OAAO,EACP,YAAY,GAAG,IAAI,EACnB,cAAc,EACd,WAAW,EACX,QAAQ,EACR,OAAO,EACP,MAAM,EACN,MAAM,EACN,QAAQ,EACR,GAAG,SAAS,EACK;IACjB,MAAM,OAAO,GAAG,kBAAkB,EAAE,CAAC;IACrC,MAAM,WAAW,GAAG,KAAK,EAAE,CAAC;IAC5B,MAAM,EAAE,GAAG,SAAS,CAAC,EAAE,IAAI,WAAW,CAAC;IACvC,MAAM,SAAS,GAAG,CAAC,CAAC,QAAQ,EAAE,SAAS,CAAC;IACxC,MAAM,QAAQ,GAAG,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,MA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,CAAC,EAAG,CACrD;QAAA,EAAE,GAAG,CAAC,CACP,CACD;MAAA,CAAC,SAAS,IAAI,CAAC,CAAC,MAAM,IAAI,CACxB,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"}
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/expresivo/ExpPageHero/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { ButtonHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export type ExpPillButtonTone = 'brand' | 'soft';
|
|
3
|
+
export type ExpPillButtonIcon = 'lens' | 'sync' | 'enter' | 'none';
|
|
4
|
+
export type ExpPillButtonProps = {
|
|
5
|
+
tone?: ExpPillButtonTone;
|
|
6
|
+
icon?: ExpPillButtonIcon;
|
|
7
|
+
/** Blocks the button and animates its glyph while the action runs. */
|
|
8
|
+
busy?: boolean;
|
|
9
|
+
/** Label shown while `busy`. Defaults to `children`. */
|
|
10
|
+
busyLabel?: string;
|
|
11
|
+
/** Takes the full width of its container. */
|
|
12
|
+
block?: boolean;
|
|
13
|
+
} & ButtonHTMLAttributes<HTMLButtonElement>;
|
|
14
|
+
/**
|
|
15
|
+
* Light pill-shaped call to action, the same 44px height as the core
|
|
16
|
+
* `Button`. `brand` is a filled lavender pill that turns into the clicOH
|
|
17
|
+
* gradient on hover, with its glyph in a white disc; `soft` is a tinted pill
|
|
18
|
+
* for secondary actions, such as a button inside a field.
|
|
19
|
+
*
|
|
20
|
+
* Outside an `ExpScope` it falls back to the core `Button`: `brand` maps to
|
|
21
|
+
* `principal` and `soft` to `second`.
|
|
22
|
+
*
|
|
23
|
+
* @component
|
|
24
|
+
* @example
|
|
25
|
+
* <ExpPillButton onClick={search}>Search</ExpPillButton>
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* <ExpPillButton tone="soft" icon="sync" busy={isSyncing} busyLabel="Syncing…">
|
|
29
|
+
* Sync
|
|
30
|
+
* </ExpPillButton>
|
|
31
|
+
*
|
|
32
|
+
* @param {Object} props - The properties of the ExpPillButton component.
|
|
33
|
+
* @param {'brand' | 'soft'} [props.tone='brand'] - Filled lavender or tinted.
|
|
34
|
+
* @param {'lens' | 'sync' | 'enter' | 'none'} [props.icon='lens'] - Glyph before the label.
|
|
35
|
+
* @param {boolean} [props.busy=false] - Blocks the button and animates its glyph.
|
|
36
|
+
* @param {string} [props.busyLabel] - Label shown while `busy`.
|
|
37
|
+
* @param {boolean} [props.block=false] - Takes the full width of its container.
|
|
38
|
+
* @param {ReactNode} props.children - Label of the action.
|
|
39
|
+
* @param {ButtonHTMLAttributes<HTMLButtonElement>} restProps - Additional properties for the button element.
|
|
40
|
+
*
|
|
41
|
+
* @returns {ReactNode} The rendered pill, or a core `Button` outside an `ExpScope`.
|
|
42
|
+
*/
|
|
43
|
+
export declare function ExpPillButton({ tone, icon, busy, busyLabel, block, disabled, children, ...restProps }: ExpPillButtonProps): ReactNode;
|
|
44
|
+
//# sourceMappingURL=ExpPillButton.d.ts.map
|
|
@@ -0,0 +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;AAEnE,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,CAAC,EAAE,iBAAiB,CAAC;IACzB,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;CACjB,GAAG,oBAAoB,CAAC,iBAAiB,CAAC,CAAC;AA+B5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,aAAa,CAAC,EAC5B,IAAc,EACd,IAAa,EACb,IAAY,EACZ,SAAS,EACT,KAAa,EACb,QAAgB,EAChB,QAAQ,EACR,GAAG,SAAS,EACb,EAAE,kBAAkB,GAAG,SAAS,CA+DhC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import { FiLogIn, FiRefreshCw, FiSearch } from 'react-icons/fi';
|
|
4
|
+
import { Button } from '@clicoh/orion-library';
|
|
5
|
+
import { useExpScope } from '../ExpScope/ExpScope';
|
|
6
|
+
import { EnterGlyph, LensGlyph, SyncBadgeGlyph, SyncGlyph, } from '../shared/glyphs';
|
|
7
|
+
const fallbackIconMap = {
|
|
8
|
+
lens: <FiSearch />,
|
|
9
|
+
sync: <FiRefreshCw />,
|
|
10
|
+
enter: <FiLogIn />,
|
|
11
|
+
none: undefined,
|
|
12
|
+
};
|
|
13
|
+
const toneMap = {
|
|
14
|
+
brand: {
|
|
15
|
+
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)]', 'hover:-translate-y-px active:translate-y-0 active:scale-[.98]'),
|
|
16
|
+
busy: 'bg-lavender dark:bg-lavender-dark cursor-progress text-white shadow-[0_3px_10px_rgba(106,93,249,0.22)]',
|
|
17
|
+
disabled: 'bg-gray-5 text-gray-2 dark:bg-gray-dark-1 cursor-not-allowed',
|
|
18
|
+
},
|
|
19
|
+
soft: {
|
|
20
|
+
idle: clsx('bg-lavender-2 text-lavender dark:bg-lavender-dark-1 dark:text-lavender-dark', 'hover:bg-lavender-1 hover:-translate-y-px active:translate-y-0 active:scale-[.98]'),
|
|
21
|
+
busy: 'bg-lavender-2 text-lavender dark:bg-lavender-dark-1 dark:text-lavender-dark cursor-progress',
|
|
22
|
+
disabled: 'bg-gray-5 text-gray-2 dark:bg-gray-dark-1 cursor-not-allowed',
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Light pill-shaped call to action, the same 44px height as the core
|
|
27
|
+
* `Button`. `brand` is a filled lavender pill that turns into the clicOH
|
|
28
|
+
* gradient on hover, with its glyph in a white disc; `soft` is a tinted pill
|
|
29
|
+
* for secondary actions, such as a button inside a field.
|
|
30
|
+
*
|
|
31
|
+
* Outside an `ExpScope` it falls back to the core `Button`: `brand` maps to
|
|
32
|
+
* `principal` and `soft` to `second`.
|
|
33
|
+
*
|
|
34
|
+
* @component
|
|
35
|
+
* @example
|
|
36
|
+
* <ExpPillButton onClick={search}>Search</ExpPillButton>
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* <ExpPillButton tone="soft" icon="sync" busy={isSyncing} busyLabel="Syncing…">
|
|
40
|
+
* Sync
|
|
41
|
+
* </ExpPillButton>
|
|
42
|
+
*
|
|
43
|
+
* @param {Object} props - The properties of the ExpPillButton component.
|
|
44
|
+
* @param {'brand' | 'soft'} [props.tone='brand'] - Filled lavender or tinted.
|
|
45
|
+
* @param {'lens' | 'sync' | 'enter' | 'none'} [props.icon='lens'] - Glyph before the label.
|
|
46
|
+
* @param {boolean} [props.busy=false] - Blocks the button and animates its glyph.
|
|
47
|
+
* @param {string} [props.busyLabel] - Label shown while `busy`.
|
|
48
|
+
* @param {boolean} [props.block=false] - Takes the full width of its container.
|
|
49
|
+
* @param {ReactNode} props.children - Label of the action.
|
|
50
|
+
* @param {ButtonHTMLAttributes<HTMLButtonElement>} restProps - Additional properties for the button element.
|
|
51
|
+
*
|
|
52
|
+
* @returns {ReactNode} The rendered pill, or a core `Button` outside an `ExpScope`.
|
|
53
|
+
*/
|
|
54
|
+
export function ExpPillButton({ tone = 'brand', icon = 'lens', busy = false, busyLabel, block = false, disabled = false, children, ...restProps }) {
|
|
55
|
+
const inScope = useExpScope();
|
|
56
|
+
const label = busy && busyLabel ? busyLabel : children;
|
|
57
|
+
if (!inScope) {
|
|
58
|
+
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)}>
|
|
59
|
+
{label}
|
|
60
|
+
</Button>);
|
|
61
|
+
}
|
|
62
|
+
const state = disabled ? 'disabled' : busy ? 'busy' : 'idle';
|
|
63
|
+
const hasDisc = tone === 'brand' && (icon === 'lens' || icon === 'sync');
|
|
64
|
+
return (<button {...restProps} disabled={disabled || busy} aria-busy={busy || undefined} className={clsx('h-11 items-center gap-2.5 rounded-full text-sm leading-5 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', block ? 'flex w-full justify-center' : 'inline-flex', icon === 'none' && 'px-6', icon !== 'none' && (hasDisc ? 'pr-[22px] pl-1.5' : 'pr-[18px] pl-3'), toneMap[tone][state], restProps.className)}>
|
|
65
|
+
{tone === 'brand' && icon === 'lens' && (<span aria-hidden="true" className={clsx('flex size-8 shrink-0 items-center justify-center rounded-full', disabled ? 'bg-gray-6' : 'bg-white')}>
|
|
66
|
+
<LensGlyph size={22} busy={busy} disabled={disabled}/>
|
|
67
|
+
</span>)}
|
|
68
|
+
{tone === 'brand' && icon === 'sync' && (<SyncBadgeGlyph size={32} busy={busy} disabled={disabled}/>)}
|
|
69
|
+
{tone === 'soft' && icon === 'lens' && (<LensGlyph size={20} busy={busy} disabled={disabled}/>)}
|
|
70
|
+
{tone === 'soft' && icon === 'sync' && (<SyncGlyph size={20} busy={busy} disabled={disabled}/>)}
|
|
71
|
+
{icon === 'enter' && (<EnterGlyph size={20} busy={busy} disabled={disabled}/>)}
|
|
72
|
+
{label}
|
|
73
|
+
</button>);
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=ExpPillButton.jsx.map
|
|
@@ -0,0 +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;AAChE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Button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EACV,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/expresivo/ExpPillButton/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
export type ExpScopeTitles = 'playful' | 'plain';
|
|
3
|
+
export type ExpScopeTables = 'cards' | 'plain';
|
|
4
|
+
export type ExpScopeMascots = 'shown' | 'hidden';
|
|
5
|
+
export type ExpScopeOptions = {
|
|
6
|
+
/** `playful` sets core headings, top menu links and table headers in the title font. */
|
|
7
|
+
titles: ExpScopeTitles;
|
|
8
|
+
/** `cards` turns core table rows into separate cards that lift on hover. */
|
|
9
|
+
tables: ExpScopeTables;
|
|
10
|
+
/** `hidden` silences every mascot, for users who prefer a quiet interface. */
|
|
11
|
+
mascots: ExpScopeMascots;
|
|
12
|
+
};
|
|
13
|
+
export type ExpScopeProps = {
|
|
14
|
+
children: ReactNode;
|
|
15
|
+
} & Partial<ExpScopeOptions>;
|
|
16
|
+
/**
|
|
17
|
+
* ExpScope turns on Orion's expressive layer for the page it renders in.
|
|
18
|
+
*
|
|
19
|
+
* Inside it, `Exp*` components render in full; outside it, they fall back to
|
|
20
|
+
* their core equivalent. While it is mounted, `assets/css/expresivo.css`
|
|
21
|
+
* reskins the core parts marked with `data-orion-part`, including the ones
|
|
22
|
+
* rendered in portals (tooltips, side filters, header menus).
|
|
23
|
+
*
|
|
24
|
+
* The options tune how loud the layer is, so a product can let its users
|
|
25
|
+
* pick a calmer look without leaving the scope.
|
|
26
|
+
*
|
|
27
|
+
* Only for consumers whose own docs declare `capa expresiva: sí`.
|
|
28
|
+
*
|
|
29
|
+
* @component
|
|
30
|
+
* @example
|
|
31
|
+
* <ExpScope>
|
|
32
|
+
* <App />
|
|
33
|
+
* </ExpScope>
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* // Core table rows and plain titles, no mascots
|
|
37
|
+
* <ExpScope titles="plain" tables="plain" mascots="hidden">
|
|
38
|
+
* <App />
|
|
39
|
+
* </ExpScope>
|
|
40
|
+
*
|
|
41
|
+
* @param {ExpScopeProps} props
|
|
42
|
+
* @param {ReactNode} props.children - Content that gets the expressive layer.
|
|
43
|
+
* @param {'playful' | 'plain'} [props.titles='playful'] - `playful` sets core headings, top menu links and table headers in the title font.
|
|
44
|
+
* @param {'cards' | 'plain'} [props.tables='cards'] - `cards` turns core table rows into separate cards; `plain` keeps the core rows.
|
|
45
|
+
* @param {'shown' | 'hidden'} [props.mascots='shown'] - `hidden` stops every `Exp*` component from drawing a mascot.
|
|
46
|
+
* @returns {ReactNode} The children inside a wrapper that adds no box.
|
|
47
|
+
*/
|
|
48
|
+
export declare function ExpScope({ children, titles, tables, mascots, }: ExpScopeProps): ReactNode;
|
|
49
|
+
/**
|
|
50
|
+
* Tells whether the caller renders inside an `ExpScope`. `Exp*` components
|
|
51
|
+
* use it to choose between their full look and their core fallback.
|
|
52
|
+
*
|
|
53
|
+
* @returns {boolean} `true` inside an `ExpScope`.
|
|
54
|
+
*/
|
|
55
|
+
export declare function useExpScope(): boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Options of the nearest `ExpScope`, for `Exp*` components that change with
|
|
58
|
+
* them.
|
|
59
|
+
*
|
|
60
|
+
* @returns {ExpScopeOptions | null} The options, or `null` outside an `ExpScope`.
|
|
61
|
+
*/
|
|
62
|
+
export declare function useExpScopeOptions(): ExpScopeOptions | null;
|
|
63
|
+
//# sourceMappingURL=ExpScope.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExpScope.d.ts","sourceRoot":"","sources":["../../src/expresivo/ExpScope/ExpScope.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAiB,KAAK,SAAS,EAAuB,MAAM,OAAO,CAAC;AAE3E,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,OAAO,CAAC;AAEjD,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,OAAO,CAAC;AAE/C,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,QAAQ,CAAC;AAEjD,MAAM,MAAM,eAAe,GAAG;IAC5B,wFAAwF;IACxF,MAAM,EAAE,cAAc,CAAC;IACvB,4EAA4E;IAC5E,MAAM,EAAE,cAAc,CAAC;IACvB,8EAA8E;IAC9E,OAAO,EAAE,eAAe,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,EAAE,SAAS,CAAC;CACrB,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;AAM7B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,QAAQ,CAAC,EACvB,QAAQ,EACR,MAAkB,EAClB,MAAgB,EAChB,OAAiB,GAClB,EAAE,aAAa,GAAG,SAAS,CAqB3B;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,IAAI,OAAO,CAErC;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,IAAI,eAAe,GAAG,IAAI,CAE3D"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { DynaPuff } from 'next/font/google';
|
|
3
|
+
import { createContext, useContext, useMemo } from 'react';
|
|
4
|
+
const titleFont = DynaPuff({ subsets: ['latin'], display: 'swap' });
|
|
5
|
+
const ExpScopeContext = createContext(null);
|
|
6
|
+
/**
|
|
7
|
+
* ExpScope turns on Orion's expressive layer for the page it renders in.
|
|
8
|
+
*
|
|
9
|
+
* Inside it, `Exp*` components render in full; outside it, they fall back to
|
|
10
|
+
* their core equivalent. While it is mounted, `assets/css/expresivo.css`
|
|
11
|
+
* reskins the core parts marked with `data-orion-part`, including the ones
|
|
12
|
+
* rendered in portals (tooltips, side filters, header menus).
|
|
13
|
+
*
|
|
14
|
+
* The options tune how loud the layer is, so a product can let its users
|
|
15
|
+
* pick a calmer look without leaving the scope.
|
|
16
|
+
*
|
|
17
|
+
* Only for consumers whose own docs declare `capa expresiva: sí`.
|
|
18
|
+
*
|
|
19
|
+
* @component
|
|
20
|
+
* @example
|
|
21
|
+
* <ExpScope>
|
|
22
|
+
* <App />
|
|
23
|
+
* </ExpScope>
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* // Core table rows and plain titles, no mascots
|
|
27
|
+
* <ExpScope titles="plain" tables="plain" mascots="hidden">
|
|
28
|
+
* <App />
|
|
29
|
+
* </ExpScope>
|
|
30
|
+
*
|
|
31
|
+
* @param {ExpScopeProps} props
|
|
32
|
+
* @param {ReactNode} props.children - Content that gets the expressive layer.
|
|
33
|
+
* @param {'playful' | 'plain'} [props.titles='playful'] - `playful` sets core headings, top menu links and table headers in the title font.
|
|
34
|
+
* @param {'cards' | 'plain'} [props.tables='cards'] - `cards` turns core table rows into separate cards; `plain` keeps the core rows.
|
|
35
|
+
* @param {'shown' | 'hidden'} [props.mascots='shown'] - `hidden` stops every `Exp*` component from drawing a mascot.
|
|
36
|
+
* @returns {ReactNode} The children inside a wrapper that adds no box.
|
|
37
|
+
*/
|
|
38
|
+
export function ExpScope({ children, titles = 'playful', tables = 'cards', mascots = 'shown', }) {
|
|
39
|
+
const options = useMemo(() => ({ titles, tables, mascots }), [titles, tables, mascots]);
|
|
40
|
+
return (<ExpScopeContext.Provider value={options}>
|
|
41
|
+
<style href="exp-title-font" precedence="exp">
|
|
42
|
+
{`:root{--exp-title-font:${titleFont.style.fontFamily}}`}
|
|
43
|
+
</style>
|
|
44
|
+
<div className="exp-scope" data-exp-titles={titles} data-exp-tables={tables} data-exp-mascots={mascots}>
|
|
45
|
+
{children}
|
|
46
|
+
</div>
|
|
47
|
+
</ExpScopeContext.Provider>);
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Tells whether the caller renders inside an `ExpScope`. `Exp*` components
|
|
51
|
+
* use it to choose between their full look and their core fallback.
|
|
52
|
+
*
|
|
53
|
+
* @returns {boolean} `true` inside an `ExpScope`.
|
|
54
|
+
*/
|
|
55
|
+
export function useExpScope() {
|
|
56
|
+
return useContext(ExpScopeContext) !== null;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Options of the nearest `ExpScope`, for `Exp*` components that change with
|
|
60
|
+
* them.
|
|
61
|
+
*
|
|
62
|
+
* @returns {ExpScopeOptions | null} The options, or `null` outside an `ExpScope`.
|
|
63
|
+
*/
|
|
64
|
+
export function useExpScopeOptions() {
|
|
65
|
+
return useContext(ExpScopeContext);
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=ExpScope.jsx.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExpScope.jsx","sourceRoot":"","sources":["../../src/expresivo/ExpScope/ExpScope.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAkB,UAAU,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAqB3E,MAAM,SAAS,GAAG,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;AAEpE,MAAM,eAAe,GAAG,aAAa,CAAyB,IAAI,CAAC,CAAC;AAEpE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAM,UAAU,QAAQ,CAAC,EACvB,QAAQ,EACR,MAAM,GAAG,SAAS,EAClB,MAAM,GAAG,OAAO,EAChB,OAAO,GAAG,OAAO,GACH;IACd,MAAM,OAAO,GAAG,OAAO,CACrB,GAAG,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,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