@umodeapporg/ui 0.37.0 → 0.38.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,14 @@
1
+ interface IChristmasTreeGlyphProps {
2
+ /** Same unit as `MaterialSymbol`: pixels at the default root size, rendered in rem. */
3
+ size: number;
4
+ /** Mirrors the FILL axis of the icon font: solid while its option is the active one. */
5
+ filled?: boolean;
6
+ }
7
+ /**
8
+ * The icon font has no Christmas tree, so the Christmas option draws its own, the same way the
9
+ * Halloween option draws its pumpkin. Single ink on the 24-unit grid of the font, taking
10
+ * `currentColor`: outlined with its ornaments hung while at rest, solid with the ornaments cut
11
+ * out of it while active.
12
+ */
13
+ declare const ChristmasTreeGlyph: React.FC<IChristmasTreeGlyphProps>;
14
+ export default ChristmasTreeGlyph;
@@ -0,0 +1,41 @@
1
+ import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
+ const STAR_PATH = "M12 .7l.59 1.49 1.6.1-1.24 1.02.4 1.55L12 4l-1.35.86.4-1.55-1.24-1.02 1.6-.1z";
3
+ const TRUNK_PATH = "M10.7 19.2h2.6v2.6h-2.6z";
4
+ const BODY_PATH = "M12 5.6l3.9 5h-1.5l3.2 4.2h-1.7l3.3 4.4H4.8l3.3-4.4H6.4l3.2-4.2H8.1z";
5
+ const ORNAMENT_RADIUS = 1.1;
6
+ const ORNAMENT_CENTERS = [
7
+ [12.6, 9.3],
8
+ [10.1, 13.3],
9
+ [14.4, 16.9],
10
+ [9.5, 17.4]
11
+ ];
12
+ const ORNAMENT_DIAMETER = ORNAMENT_RADIUS * 2;
13
+ const ORNAMENTS_PATH = ORNAMENT_CENTERS.map(
14
+ ([x, y]) => `M${(x - ORNAMENT_RADIUS).toFixed(2)} ${y}a${ORNAMENT_RADIUS} ${ORNAMENT_RADIUS} 0 1 0 ${ORNAMENT_DIAMETER} 0a${ORNAMENT_RADIUS} ${ORNAMENT_RADIUS} 0 1 0 -${ORNAMENT_DIAMETER} 0z`
15
+ ).join("");
16
+ const ChristmasTreeGlyph = ({ size, filled = false }) => {
17
+ const sizeInRem = `${size / 16}rem`;
18
+ return /* @__PURE__ */ jsxs(
19
+ "svg",
20
+ {
21
+ viewBox: "0 0 24 24",
22
+ "aria-hidden": true,
23
+ focusable: "false",
24
+ fill: "currentColor",
25
+ className: "shrink-0",
26
+ style: { width: sizeInRem, height: sizeInRem },
27
+ children: [
28
+ /* @__PURE__ */ jsx("path", { d: STAR_PATH }),
29
+ /* @__PURE__ */ jsx("path", { d: TRUNK_PATH }),
30
+ filled ? /* @__PURE__ */ jsx("path", { d: `${BODY_PATH}${ORNAMENTS_PATH}`, fillRule: "evenodd" }) : /* @__PURE__ */ jsxs(Fragment, { children: [
31
+ /* @__PURE__ */ jsx("path", { d: BODY_PATH, fill: "none", stroke: "currentColor", strokeWidth: 1.5, strokeLinejoin: "round" }),
32
+ /* @__PURE__ */ jsx("path", { d: ORNAMENTS_PATH })
33
+ ] })
34
+ ]
35
+ }
36
+ );
37
+ };
38
+ export {
39
+ ChristmasTreeGlyph as default
40
+ };
41
+ //# sourceMappingURL=ChristmasTreeGlyph.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChristmasTreeGlyph.js","sources":["../../../src/components/Shell/ChristmasTreeGlyph.tsx"],"sourcesContent":["interface IChristmasTreeGlyphProps {\n /** Same unit as `MaterialSymbol`: pixels at the default root size, rendered in rem. */\n size: number;\n /** Mirrors the FILL axis of the icon font: solid while its option is the active one. */\n filled?: boolean;\n}\n\nconst STAR_PATH = 'M12 .7l.59 1.49 1.6.1-1.24 1.02.4 1.55L12 4l-1.35.86.4-1.55-1.24-1.02 1.6-.1z';\nconst TRUNK_PATH = 'M10.7 19.2h2.6v2.6h-2.6z';\nconst BODY_PATH = 'M12 5.6l3.9 5h-1.5l3.2 4.2h-1.7l3.3 4.4H4.8l3.3-4.4H6.4l3.2-4.2H8.1z';\n\nconst ORNAMENT_RADIUS = 1.1;\nconst ORNAMENT_CENTERS: ReadonlyArray<[number, number]> = [\n [12.6, 9.3],\n [10.1, 13.3],\n [14.4, 16.9],\n [9.5, 17.4],\n];\n\nconst ORNAMENT_DIAMETER = ORNAMENT_RADIUS * 2;\n\nconst ORNAMENTS_PATH = ORNAMENT_CENTERS.map(\n ([x, y]) =>\n `M${(x - ORNAMENT_RADIUS).toFixed(2)} ${y}a${ORNAMENT_RADIUS} ${ORNAMENT_RADIUS} 0 1 0 ${ORNAMENT_DIAMETER} 0a${ORNAMENT_RADIUS} ${ORNAMENT_RADIUS} 0 1 0 -${ORNAMENT_DIAMETER} 0z`,\n).join('');\n\n/**\n * The icon font has no Christmas tree, so the Christmas option draws its own, the same way the\n * Halloween option draws its pumpkin. Single ink on the 24-unit grid of the font, taking\n * `currentColor`: outlined with its ornaments hung while at rest, solid with the ornaments cut\n * out of it while active.\n */\nconst ChristmasTreeGlyph: React.FC<IChristmasTreeGlyphProps> = ({ size, filled = false }) => {\n const sizeInRem = `${size / 16}rem`;\n\n return (\n <svg\n viewBox=\"0 0 24 24\"\n aria-hidden\n focusable=\"false\"\n fill=\"currentColor\"\n className=\"shrink-0\"\n style={{ width: sizeInRem, height: sizeInRem }}\n >\n <path d={STAR_PATH} />\n <path d={TRUNK_PATH} />\n {filled ? (\n <path d={`${BODY_PATH}${ORNAMENTS_PATH}`} fillRule=\"evenodd\" />\n ) : (\n <>\n <path d={BODY_PATH} fill=\"none\" stroke=\"currentColor\" strokeWidth={1.5} strokeLinejoin=\"round\" />\n <path d={ORNAMENTS_PATH} />\n </>\n )}\n </svg>\n );\n};\n\nexport default ChristmasTreeGlyph;\n"],"names":[],"mappings":";AAOA,MAAM,YAAY;AAClB,MAAM,aAAa;AACnB,MAAM,YAAY;AAElB,MAAM,kBAAkB;AACxB,MAAM,mBAAoD;AAAA,EACxD,CAAC,MAAM,GAAG;AAAA,EACV,CAAC,MAAM,IAAI;AAAA,EACX,CAAC,MAAM,IAAI;AAAA,EACX,CAAC,KAAK,IAAI;AACZ;AAEA,MAAM,oBAAoB,kBAAkB;AAE5C,MAAM,iBAAiB,iBAAiB;AAAA,EACtC,CAAC,CAAC,GAAG,CAAC,MACJ,KAAK,IAAI,iBAAiB,QAAQ,CAAC,CAAC,IAAI,CAAC,IAAI,eAAe,IAAI,eAAe,UAAU,iBAAiB,MAAM,eAAe,IAAI,eAAe,WAAW,iBAAiB;AAClL,EAAE,KAAK,EAAE;AAQT,MAAM,qBAAyD,CAAC,EAAE,MAAM,SAAS,YAAY;AAC3F,QAAM,YAAY,GAAG,OAAO,EAAE;AAE9B,SACE;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,SAAQ;AAAA,MACR,eAAW;AAAA,MACX,WAAU;AAAA,MACV,MAAK;AAAA,MACL,WAAU;AAAA,MACV,OAAO,EAAE,OAAO,WAAW,QAAQ,UAAA;AAAA,MAEnC,UAAA;AAAA,QAAA,oBAAC,QAAA,EAAK,GAAG,UAAA,CAAW;AAAA,QACpB,oBAAC,QAAA,EAAK,GAAG,WAAA,CAAY;AAAA,QACpB,SACC,oBAAC,QAAA,EAAK,GAAG,GAAG,SAAS,GAAG,cAAc,IAAI,UAAS,UAAA,CAAU,IAE7D,qBAAA,UAAA,EACE,UAAA;AAAA,UAAA,oBAAC,QAAA,EAAK,GAAG,WAAW,MAAK,QAAO,QAAO,gBAAe,aAAa,KAAK,gBAAe,QAAA,CAAQ;AAAA,UAC/F,oBAAC,QAAA,EAAK,GAAG,eAAA,CAAgB;AAAA,QAAA,EAAA,CAC3B;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIR;"}
@@ -4,6 +4,7 @@ import { useTranslation } from "react-i18next";
4
4
  import ControlledButton from "../Form/ControlledButton.js";
5
5
  import ControlledTooltip from "../UI/ControlledTooltip.js";
6
6
  import { MaterialSymbol } from "../UI/MaterialSymbol/index.js";
7
+ import ChristmasTreeGlyph from "./ChristmasTreeGlyph.js";
7
8
  import { HEADER_CONTROL_SHELL_CLASS, HEADER_CONTROL_SIZE_REM } from "./headerControlStyles.js";
8
9
  import PumpkinGlyph from "./PumpkinGlyph.js";
9
10
  const OPTION_SIZE_REM = HEADER_CONTROL_SIZE_REM;
@@ -16,6 +17,10 @@ const OPTION_PRESENTATION = {
16
17
  halloween: {
17
18
  labelKey: "theme.halloween",
18
19
  renderIcon: (isActive) => /* @__PURE__ */ jsx(PumpkinGlyph, { size: OPTION_ICON_SIZE, filled: isActive })
20
+ },
21
+ christmas: {
22
+ labelKey: "theme.christmas",
23
+ renderIcon: (isActive) => /* @__PURE__ */ jsx(ChristmasTreeGlyph, { size: OPTION_ICON_SIZE, filled: isActive })
19
24
  }
20
25
  };
21
26
  const DEFAULT_OPTIONS = ["light", "system", "dark"];
@@ -1 +1 @@
1
- {"version":3,"file":"ThemeToggle.js","sources":["../../../src/components/Shell/ThemeToggle.tsx"],"sourcesContent":["import { ReactNode } from 'react';\nimport classNames from 'classnames';\nimport { useTranslation } from 'react-i18next';\n\nimport ControlledButton from '@/components/Form/ControlledButton';\nimport ControlledTooltip from '@/components/UI/ControlledTooltip';\nimport { MaterialSymbol, SymbolCodepoints } from '@/components/UI/MaterialSymbol';\nimport { TUiThemeSkin } from '@/helpers/themeSkins';\n\nimport { HEADER_CONTROL_SHELL_CLASS, HEADER_CONTROL_SIZE_REM } from './headerControlStyles';\nimport PumpkinGlyph from './PumpkinGlyph';\n\nconst OPTION_SIZE_REM = HEADER_CONTROL_SIZE_REM;\nconst OPTION_ICON_SIZE = 15;\n\nexport type TUiThemePreference = 'light' | 'system' | 'dark';\n\n/** A skin is one more position of the knob: choosing it is choosing its scheme, re-coloured. */\nexport type TUiThemeToggleOption = TUiThemePreference | TUiThemeSkin;\n\ninterface IOptionPresentation {\n labelKey: string;\n renderIcon: (isActive: boolean) => ReactNode;\n}\n\nconst renderSymbol = (icon: SymbolCodepoints) => (isActive: boolean) => (\n <MaterialSymbol icon={icon} size={OPTION_ICON_SIZE} fill={isActive} />\n);\n\nconst OPTION_PRESENTATION: Record<TUiThemeToggleOption, IOptionPresentation> = {\n light: { labelKey: 'theme.light', renderIcon: renderSymbol('light_mode') },\n system: { labelKey: 'theme.system', renderIcon: renderSymbol('computer') },\n dark: { labelKey: 'theme.dark', renderIcon: renderSymbol('dark_mode') },\n halloween: {\n labelKey: 'theme.halloween',\n renderIcon: (isActive) => <PumpkinGlyph size={OPTION_ICON_SIZE} filled={isActive} />,\n },\n};\n\nconst DEFAULT_OPTIONS: ReadonlyArray<TUiThemePreference> = ['light', 'system', 'dark'];\n\ninterface IThemeToggleProps<TOption extends TUiThemeToggleOption = TUiThemePreference> {\n preference: TOption;\n onChange: (preference: TOption) => void;\n /** Positions of the knob, in order. Defaults to light, system and dark; the host adds a\n skin for as long as it is on offer and drops it again when the season ends. */\n options?: ReadonlyArray<TOption>;\n}\n\n/**\n * The theme control: an explicit light/dark choice, `system` to follow the OS, and any skin\n * the host is offering. The host owns the preference (persistence + writing `data-theme` and\n * `data-theme-skin` on <html>); this renders the knob.\n */\nconst ThemeToggle = <TOption extends TUiThemeToggleOption = TUiThemePreference>({\n preference,\n onChange,\n options,\n}: IThemeToggleProps<TOption>) => {\n const { t } = useTranslation('ui');\n\n const requestedOptions = (\n Array.isArray(options) && options.length > 0 ? options : DEFAULT_OPTIONS\n ) as ReadonlyArray<TOption>;\n const visibleOptions = requestedOptions.filter((option) => Boolean(OPTION_PRESENTATION[option]));\n const activeIndex = visibleOptions.indexOf(preference);\n\n return (\n <div role=\"group\" aria-label={t('theme.toggle')} className={HEADER_CONTROL_SHELL_CLASS}>\n <div className=\"relative flex items-center\">\n {activeIndex >= 0 && (\n <div\n aria-hidden\n className=\"pointer-events-none absolute left-0 top-0 rounded-full bg-surface shadow-elevation1 ring-1 ring-border transition-transform duration-base ease-enter\"\n style={{\n width: `${OPTION_SIZE_REM}rem`,\n height: `${OPTION_SIZE_REM}rem`,\n transform: `translateX(${activeIndex * OPTION_SIZE_REM}rem)`,\n }}\n />\n )}\n\n {visibleOptions.map((option) => {\n const isActive = option === preference;\n const presentation = OPTION_PRESENTATION[option];\n\n return (\n <ControlledTooltip key={option} content={t(presentation.labelKey)}>\n <ControlledButton\n aria-label={t(presentation.labelKey)}\n defaultHtmlButton\n aria-pressed={isActive}\n onClick={() => onChange(option)}\n className={classNames(\n 'relative z-10 flex shrink-0 items-center justify-center rounded-full leading-none transition-colors duration-base',\n isActive ? 'text-brand-emphasis' : 'text-foreground-subtle hover:text-foreground-muted',\n )}\n style={{ width: `${OPTION_SIZE_REM}rem`, height: `${OPTION_SIZE_REM}rem` }}\n >\n {presentation.renderIcon(isActive)}\n </ControlledButton>\n </ControlledTooltip>\n );\n })}\n </div>\n </div>\n );\n};\n\nexport default ThemeToggle;\n"],"names":[],"mappings":";;;;;;;;AAYA,MAAM,kBAAkB;AACxB,MAAM,mBAAmB;AAYzB,MAAM,eAAe,CAAC,SAA2B,CAAC,aAChD,oBAAC,gBAAA,EAAe,MAAY,MAAM,kBAAkB,MAAM,SAAA,CAAU;AAGtE,MAAM,sBAAyE;AAAA,EAC7E,OAAO,EAAE,UAAU,eAAe,YAAY,aAAa,YAAY,EAAA;AAAA,EACvE,QAAQ,EAAE,UAAU,gBAAgB,YAAY,aAAa,UAAU,EAAA;AAAA,EACvE,MAAM,EAAE,UAAU,cAAc,YAAY,aAAa,WAAW,EAAA;AAAA,EACpE,WAAW;AAAA,IACT,UAAU;AAAA,IACV,YAAY,CAAC,aAAa,oBAAC,gBAAa,MAAM,kBAAkB,QAAQ,SAAA,CAAU;AAAA,EAAA;AAEtF;AAEA,MAAM,kBAAqD,CAAC,SAAS,UAAU,MAAM;AAerF,MAAM,cAAc,CAA4D;AAAA,EAC9E;AAAA,EACA;AAAA,EACA;AACF,MAAkC;AAChC,QAAM,EAAE,EAAA,IAAM,eAAe,IAAI;AAEjC,QAAM,mBACJ,MAAM,QAAQ,OAAO,KAAK,QAAQ,SAAS,IAAI,UAAU;AAE3D,QAAM,iBAAiB,iBAAiB,OAAO,CAAC,WAAW,QAAQ,oBAAoB,MAAM,CAAC,CAAC;AAC/F,QAAM,cAAc,eAAe,QAAQ,UAAU;AAErD,SACE,oBAAC,OAAA,EAAI,MAAK,SAAQ,cAAY,EAAE,cAAc,GAAG,WAAW,4BAC1D,UAAA,qBAAC,OAAA,EAAI,WAAU,8BACZ,UAAA;AAAA,IAAA,eAAe,KACd;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,eAAW;AAAA,QACX,WAAU;AAAA,QACV,OAAO;AAAA,UACL,OAAO,GAAG,eAAe;AAAA,UACzB,QAAQ,GAAG,eAAe;AAAA,UAC1B,WAAW,cAAc,cAAc,eAAe;AAAA,QAAA;AAAA,MACxD;AAAA,IAAA;AAAA,IAIH,eAAe,IAAI,CAAC,WAAW;AAC9B,YAAM,WAAW,WAAW;AAC5B,YAAM,eAAe,oBAAoB,MAAM;AAE/C,iCACG,mBAAA,EAA+B,SAAS,EAAE,aAAa,QAAQ,GAC9D,UAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,cAAY,EAAE,aAAa,QAAQ;AAAA,UACnC,mBAAiB;AAAA,UACjB,gBAAc;AAAA,UACd,SAAS,MAAM,SAAS,MAAM;AAAA,UAC9B,WAAW;AAAA,YACT;AAAA,YACA,WAAW,wBAAwB;AAAA,UAAA;AAAA,UAErC,OAAO,EAAE,OAAO,GAAG,eAAe,OAAO,QAAQ,GAAG,eAAe,MAAA;AAAA,UAElE,UAAA,aAAa,WAAW,QAAQ;AAAA,QAAA;AAAA,MAAA,KAZb,MAcxB;AAAA,IAEJ,CAAC;AAAA,EAAA,EAAA,CACH,EAAA,CACF;AAEJ;"}
1
+ {"version":3,"file":"ThemeToggle.js","sources":["../../../src/components/Shell/ThemeToggle.tsx"],"sourcesContent":["import { ReactNode } from 'react';\nimport classNames from 'classnames';\nimport { useTranslation } from 'react-i18next';\n\nimport ControlledButton from '@/components/Form/ControlledButton';\nimport ControlledTooltip from '@/components/UI/ControlledTooltip';\nimport { MaterialSymbol, SymbolCodepoints } from '@/components/UI/MaterialSymbol';\nimport { TUiThemeSkin } from '@/helpers/themeSkins';\n\nimport ChristmasTreeGlyph from './ChristmasTreeGlyph';\nimport { HEADER_CONTROL_SHELL_CLASS, HEADER_CONTROL_SIZE_REM } from './headerControlStyles';\nimport PumpkinGlyph from './PumpkinGlyph';\n\nconst OPTION_SIZE_REM = HEADER_CONTROL_SIZE_REM;\nconst OPTION_ICON_SIZE = 15;\n\nexport type TUiThemePreference = 'light' | 'system' | 'dark';\n\n/** A skin is one more position of the knob: choosing it is choosing its scheme, re-coloured. */\nexport type TUiThemeToggleOption = TUiThemePreference | TUiThemeSkin;\n\ninterface IOptionPresentation {\n labelKey: string;\n renderIcon: (isActive: boolean) => ReactNode;\n}\n\nconst renderSymbol = (icon: SymbolCodepoints) => (isActive: boolean) => (\n <MaterialSymbol icon={icon} size={OPTION_ICON_SIZE} fill={isActive} />\n);\n\nconst OPTION_PRESENTATION: Record<TUiThemeToggleOption, IOptionPresentation> = {\n light: { labelKey: 'theme.light', renderIcon: renderSymbol('light_mode') },\n system: { labelKey: 'theme.system', renderIcon: renderSymbol('computer') },\n dark: { labelKey: 'theme.dark', renderIcon: renderSymbol('dark_mode') },\n halloween: {\n labelKey: 'theme.halloween',\n renderIcon: (isActive) => <PumpkinGlyph size={OPTION_ICON_SIZE} filled={isActive} />,\n },\n christmas: {\n labelKey: 'theme.christmas',\n renderIcon: (isActive) => <ChristmasTreeGlyph size={OPTION_ICON_SIZE} filled={isActive} />,\n },\n};\n\nconst DEFAULT_OPTIONS: ReadonlyArray<TUiThemePreference> = ['light', 'system', 'dark'];\n\ninterface IThemeToggleProps<TOption extends TUiThemeToggleOption = TUiThemePreference> {\n preference: TOption;\n onChange: (preference: TOption) => void;\n /** Positions of the knob, in order. Defaults to light, system and dark; the host adds a\n skin for as long as it is on offer and drops it again when the season ends. */\n options?: ReadonlyArray<TOption>;\n}\n\n/**\n * The theme control: an explicit light/dark choice, `system` to follow the OS, and any skin\n * the host is offering. The host owns the preference (persistence + writing `data-theme` and\n * `data-theme-skin` on <html>); this renders the knob.\n */\nconst ThemeToggle = <TOption extends TUiThemeToggleOption = TUiThemePreference>({\n preference,\n onChange,\n options,\n}: IThemeToggleProps<TOption>) => {\n const { t } = useTranslation('ui');\n\n const requestedOptions = (\n Array.isArray(options) && options.length > 0 ? options : DEFAULT_OPTIONS\n ) as ReadonlyArray<TOption>;\n const visibleOptions = requestedOptions.filter((option) => Boolean(OPTION_PRESENTATION[option]));\n const activeIndex = visibleOptions.indexOf(preference);\n\n return (\n <div role=\"group\" aria-label={t('theme.toggle')} className={HEADER_CONTROL_SHELL_CLASS}>\n <div className=\"relative flex items-center\">\n {activeIndex >= 0 && (\n <div\n aria-hidden\n className=\"pointer-events-none absolute left-0 top-0 rounded-full bg-surface shadow-elevation1 ring-1 ring-border transition-transform duration-base ease-enter\"\n style={{\n width: `${OPTION_SIZE_REM}rem`,\n height: `${OPTION_SIZE_REM}rem`,\n transform: `translateX(${activeIndex * OPTION_SIZE_REM}rem)`,\n }}\n />\n )}\n\n {visibleOptions.map((option) => {\n const isActive = option === preference;\n const presentation = OPTION_PRESENTATION[option];\n\n return (\n <ControlledTooltip key={option} content={t(presentation.labelKey)}>\n <ControlledButton\n aria-label={t(presentation.labelKey)}\n defaultHtmlButton\n aria-pressed={isActive}\n onClick={() => onChange(option)}\n className={classNames(\n 'relative z-10 flex shrink-0 items-center justify-center rounded-full leading-none transition-colors duration-base',\n isActive ? 'text-brand-emphasis' : 'text-foreground-subtle hover:text-foreground-muted',\n )}\n style={{ width: `${OPTION_SIZE_REM}rem`, height: `${OPTION_SIZE_REM}rem` }}\n >\n {presentation.renderIcon(isActive)}\n </ControlledButton>\n </ControlledTooltip>\n );\n })}\n </div>\n </div>\n );\n};\n\nexport default ThemeToggle;\n"],"names":[],"mappings":";;;;;;;;;AAaA,MAAM,kBAAkB;AACxB,MAAM,mBAAmB;AAYzB,MAAM,eAAe,CAAC,SAA2B,CAAC,aAChD,oBAAC,gBAAA,EAAe,MAAY,MAAM,kBAAkB,MAAM,SAAA,CAAU;AAGtE,MAAM,sBAAyE;AAAA,EAC7E,OAAO,EAAE,UAAU,eAAe,YAAY,aAAa,YAAY,EAAA;AAAA,EACvE,QAAQ,EAAE,UAAU,gBAAgB,YAAY,aAAa,UAAU,EAAA;AAAA,EACvE,MAAM,EAAE,UAAU,cAAc,YAAY,aAAa,WAAW,EAAA;AAAA,EACpE,WAAW;AAAA,IACT,UAAU;AAAA,IACV,YAAY,CAAC,aAAa,oBAAC,gBAAa,MAAM,kBAAkB,QAAQ,SAAA,CAAU;AAAA,EAAA;AAAA,EAEpF,WAAW;AAAA,IACT,UAAU;AAAA,IACV,YAAY,CAAC,aAAa,oBAAC,sBAAmB,MAAM,kBAAkB,QAAQ,SAAA,CAAU;AAAA,EAAA;AAE5F;AAEA,MAAM,kBAAqD,CAAC,SAAS,UAAU,MAAM;AAerF,MAAM,cAAc,CAA4D;AAAA,EAC9E;AAAA,EACA;AAAA,EACA;AACF,MAAkC;AAChC,QAAM,EAAE,EAAA,IAAM,eAAe,IAAI;AAEjC,QAAM,mBACJ,MAAM,QAAQ,OAAO,KAAK,QAAQ,SAAS,IAAI,UAAU;AAE3D,QAAM,iBAAiB,iBAAiB,OAAO,CAAC,WAAW,QAAQ,oBAAoB,MAAM,CAAC,CAAC;AAC/F,QAAM,cAAc,eAAe,QAAQ,UAAU;AAErD,SACE,oBAAC,OAAA,EAAI,MAAK,SAAQ,cAAY,EAAE,cAAc,GAAG,WAAW,4BAC1D,UAAA,qBAAC,OAAA,EAAI,WAAU,8BACZ,UAAA;AAAA,IAAA,eAAe,KACd;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,eAAW;AAAA,QACX,WAAU;AAAA,QACV,OAAO;AAAA,UACL,OAAO,GAAG,eAAe;AAAA,UACzB,QAAQ,GAAG,eAAe;AAAA,UAC1B,WAAW,cAAc,cAAc,eAAe;AAAA,QAAA;AAAA,MACxD;AAAA,IAAA;AAAA,IAIH,eAAe,IAAI,CAAC,WAAW;AAC9B,YAAM,WAAW,WAAW;AAC5B,YAAM,eAAe,oBAAoB,MAAM;AAE/C,iCACG,mBAAA,EAA+B,SAAS,EAAE,aAAa,QAAQ,GAC9D,UAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,cAAY,EAAE,aAAa,QAAQ;AAAA,UACnC,mBAAiB;AAAA,UACjB,gBAAc;AAAA,UACd,SAAS,MAAM,SAAS,MAAM;AAAA,UAC9B,WAAW;AAAA,YACT;AAAA,YACA,WAAW,wBAAwB;AAAA,UAAA;AAAA,UAErC,OAAO,EAAE,OAAO,GAAG,eAAe,OAAO,QAAQ,GAAG,eAAe,MAAA;AAAA,UAElE,UAAA,aAAa,WAAW,QAAQ;AAAA,QAAA;AAAA,MAAA,KAZb,MAcxB;AAAA,IAEJ,CAAC;AAAA,EAAA,EAAA,CACH,EAAA,CACF;AAEJ;"}
@@ -6,6 +6,7 @@ export declare const UI_THEME_SKIN_ATTRIBUTE = "data-theme-skin";
6
6
  */
7
7
  export declare const UI_THEME_SKIN_SCHEMES: {
8
8
  readonly halloween: "dark";
9
+ readonly christmas: "dark";
9
10
  };
10
11
  export type TUiThemeSkin = keyof typeof UI_THEME_SKIN_SCHEMES;
11
12
  export declare const UI_THEME_SKINS: Array<TUiThemeSkin>;
@@ -1,6 +1,7 @@
1
1
  const UI_THEME_SKIN_ATTRIBUTE = "data-theme-skin";
2
2
  const UI_THEME_SKIN_SCHEMES = {
3
- halloween: "dark"
3
+ halloween: "dark",
4
+ christmas: "dark"
4
5
  };
5
6
  const UI_THEME_SKINS = Object.keys(UI_THEME_SKIN_SCHEMES);
6
7
  const isUiThemeSkin = (value) => typeof value === "string" && UI_THEME_SKINS.includes(value);
@@ -1 +1 @@
1
- {"version":3,"file":"themeSkins.js","sources":["../../src/helpers/themeSkins.ts"],"sourcesContent":["import type { TUiResolvedTheme } from '../hooks/useResolvedTheme';\n\nexport const UI_THEME_SKIN_ATTRIBUTE = 'data-theme-skin';\n\n/**\n * A skin re-colours exactly ONE scheme (see the Skins block in theme.css). The host paints it\n * by writing that scheme to `data-theme` and the skin name to `data-theme-skin`, so everything\n * that only understands light and dark keeps working untouched.\n */\nexport const UI_THEME_SKIN_SCHEMES = {\n halloween: 'dark',\n} as const satisfies Record<string, TUiResolvedTheme>;\n\nexport type TUiThemeSkin = keyof typeof UI_THEME_SKIN_SCHEMES;\n\nexport const UI_THEME_SKINS = Object.keys(UI_THEME_SKIN_SCHEMES) as Array<TUiThemeSkin>;\n\nexport const isUiThemeSkin = (value: unknown): value is TUiThemeSkin =>\n typeof value === 'string' && (UI_THEME_SKINS as Array<string>).includes(value);\n"],"names":[],"mappings":"AAEO,MAAM,0BAA0B;AAOhC,MAAM,wBAAwB;AAAA,EACnC,WAAW;AACb;AAIO,MAAM,iBAAiB,OAAO,KAAK,qBAAqB;AAExD,MAAM,gBAAgB,CAAC,UAC5B,OAAO,UAAU,YAAa,eAAiC,SAAS,KAAK;"}
1
+ {"version":3,"file":"themeSkins.js","sources":["../../src/helpers/themeSkins.ts"],"sourcesContent":["import type { TUiResolvedTheme } from '../hooks/useResolvedTheme';\n\nexport const UI_THEME_SKIN_ATTRIBUTE = 'data-theme-skin';\n\n/**\n * A skin re-colours exactly ONE scheme (see the Skins block in theme.css). The host paints it\n * by writing that scheme to `data-theme` and the skin name to `data-theme-skin`, so everything\n * that only understands light and dark keeps working untouched.\n */\nexport const UI_THEME_SKIN_SCHEMES = {\n halloween: 'dark',\n christmas: 'dark',\n} as const satisfies Record<string, TUiResolvedTheme>;\n\nexport type TUiThemeSkin = keyof typeof UI_THEME_SKIN_SCHEMES;\n\nexport const UI_THEME_SKINS = Object.keys(UI_THEME_SKIN_SCHEMES) as Array<TUiThemeSkin>;\n\nexport const isUiThemeSkin = (value: unknown): value is TUiThemeSkin =>\n typeof value === 'string' && (UI_THEME_SKINS as Array<string>).includes(value);\n"],"names":[],"mappings":"AAEO,MAAM,0BAA0B;AAOhC,MAAM,wBAAwB;AAAA,EACnC,WAAW;AAAA,EACX,WAAW;AACb;AAIO,MAAM,iBAAiB,OAAO,KAAK,qBAAqB;AAExD,MAAM,gBAAgB,CAAC,UAC5B,OAAO,UAAU,YAAa,eAAiC,SAAS,KAAK;"}
@@ -644,7 +644,8 @@ declare const _default: {
644
644
  "light": "Light theme",
645
645
  "dark": "Dark theme",
646
646
  "system": "Follow system",
647
- "halloween": "Halloween theme"
647
+ "halloween": "Halloween theme",
648
+ "christmas": "Christmas theme"
648
649
  },
649
650
  "toast": {
650
651
  "learnMore": "Learn more"
@@ -29,7 +29,7 @@ const pagination = { "resultsPerPage": "Results per page", "pageOf": "Page {{cur
29
29
  const permissions = { "deniedAction": "This action is not open to your profile. An account administrator can grant access.", "deniedRequest": "This action is not open to your user profile.", "checkingAccess": "Checking permissions...", "deniedPage": { "resource": "Page: {{resource}}", "backToHome": "Back to start", "nextStepsTitle": "What to do now", "service": { "title": "This module is not part of your account", "message": "The module behind this page is not among the services your account has, so no user in it can open the page.", "nextStep": "Talk to whoever owns the account at uMode to add this module. Everything else you already use keeps working." }, "capability": { "title": "This page is not open to you yet", "message": "Your account has this page, but your user profile does not include permission to open it yet.", "nextStep": "An account administrator can grant it in Settings, Access Control, under your user profile. It takes seconds and applies from your next visit." }, "request": { "title": "This page needs a permission you do not have yet", "message": "You got this far, but while loading this screen we found that your user profile does not have access to its information.", "nextStep": "An account administrator can grant it in Settings, Access Control. If access was just granted, use Try again. None of your work was affected." } } };
30
30
  const requestErrors = { "denied": { "title": "This area is not open to you yet", "description": "Your user profile does not include access to this content. An account administrator can grant it in Settings, Access Control." }, "notFound": { "title": "We could not find this item", "description": "It may have been deleted by someone on the team, or the link that brought you here is out of date." }, "offline": { "title": "The connection seems to have dropped", "description": "Check your connection and try again in a few seconds. Nothing you had already saved was lost." }, "server": { "title": "Something is unstable on our side", "description": "The problem is on our end, not something you did. Try again in a moment; if it keeps happening, contact support." }, "unknown": { "title": "We could not load this part", "description": "This is usually temporary. Try again and, if it stays like this, contact support and tell them what you were doing." } };
31
31
  const sidebar = { "home": "Home", "logout": "Sign out", "openSidebar": "Open sidebar", "collapseSidebar": "Collapse sidebar", "favorites": { "add": "Add to favorites", "remove": "Remove from favorites" }, "sections": { "favorites": "Favorites", "management": "Management", "registration": "Records" } };
32
- const theme = { "toggle": "Theme", "light": "Light theme", "dark": "Dark theme", "system": "Follow system", "halloween": "Halloween theme" };
32
+ const theme = { "toggle": "Theme", "light": "Light theme", "dark": "Dark theme", "system": "Follow system", "halloween": "Halloween theme", "christmas": "Christmas theme" };
33
33
  const toast = { "learnMore": "Learn more" };
34
34
  const unifiedSearchBar = { "clearFilter": "Clear filter" };
35
35
  const uploader = { "dragOr": "Drag or", "selectFile": "select a file", "orPaste": "or paste (Ctrl+V)", "allowedFormats": "Allowed formats:", "upTo": "up to", "megabytesSuffix": "MB", "sendFiles": "Send file(s)", "filesIgnoredMaxSize": "Some files were ignored because they exceeded the maximum size of {{size}}MB", "invalidFormat": "Please add files in the allowed formats", "allowedFormatsTooltip": "Allowed formats: {{formats}} up to {{size}}MB", "anyFormatUpTo": "Any format up to {{size}} MB", "filesBlocked": "This file type is not accepted: {{files}}.", "filesOverMaxSize": "Over the {{size}} MB limit: {{files}}." };
@@ -647,6 +647,7 @@ export declare const uiLocales: {
647
647
  dark: string;
648
648
  system: string;
649
649
  halloween: string;
650
+ christmas: string;
650
651
  };
651
652
  toast: {
652
653
  learnMore: string;
@@ -1340,6 +1341,7 @@ export declare const uiLocales: {
1340
1341
  dark: string;
1341
1342
  system: string;
1342
1343
  halloween: string;
1344
+ christmas: string;
1343
1345
  };
1344
1346
  toast: {
1345
1347
  learnMore: string;
@@ -644,7 +644,8 @@ declare const _default: {
644
644
  "light": "Tema claro",
645
645
  "dark": "Tema escuro",
646
646
  "system": "Seguir o sistema",
647
- "halloween": "Tema de Halloween"
647
+ "halloween": "Tema de Halloween",
648
+ "christmas": "Tema de Natal"
648
649
  },
649
650
  "toast": {
650
651
  "learnMore": "Saiba Mais"
@@ -29,7 +29,7 @@ const pagination = { "resultsPerPage": "Resultados por página", "pageOf": "Pág
29
29
  const permissions = { "deniedAction": "Esta ação não está liberada para o seu perfil. Um administrador da conta pode liberar o acesso.", "deniedRequest": "Esta ação não está liberada para o seu perfil de usuário.", "checkingAccess": "Verificando permissões...", "deniedPage": { "resource": "Página: {{resource}}", "backToHome": "Voltar para o início", "nextStepsTitle": "O que fazer agora", "service": { "title": "Este módulo não faz parte da sua conta", "message": "O módulo que abre esta página ainda não está entre os serviços contratados pela sua conta, então ele não pode ser aberto por nenhum usuário dela.", "nextStep": "Fale com a pessoa responsável pela conta na uMode para incluir este módulo. Enquanto isso, o restante do que você já usa segue funcionando normalmente." }, "capability": { "title": "Esta página ainda não está liberada para você", "message": "A sua conta tem esta página, mas o seu perfil de usuário ainda não inclui a permissão para abri-la.", "nextStep": "Um administrador da conta pode liberar em Configurações, Controle de Acesso, escolhendo o seu perfil de usuário. Leva alguns segundos e vale a partir do próximo acesso." }, "request": { "title": "Esta página precisa de uma permissão que você ainda não tem", "message": "Você chegou até aqui, mas ao buscar as informações desta tela percebemos que o seu perfil de usuário não tem acesso a elas.", "nextStep": "Um administrador da conta pode liberar em Configurações, Controle de Acesso. Se o acesso acabou de ser concedido, use Tentar novamente. Nada do seu trabalho foi afetado." } } };
30
30
  const requestErrors = { "denied": { "title": "Esta área ainda não está liberada para você", "description": "Seu perfil de usuário não inclui o acesso a este conteúdo. Um administrador da conta pode liberar em Configurações, Controle de Acesso." }, "notFound": { "title": "Não encontramos este item", "description": "Ele pode ter sido excluído por alguém da equipe, ou o link usado para chegar até aqui está desatualizado." }, "offline": { "title": "Parece que a conexão caiu", "description": "Confira sua conexão e tente de novo em alguns segundos. Nada do que já foi salvo se perdeu." }, "server": { "title": "Estamos com uma instabilidade", "description": "O problema é aqui do nosso lado, não em algo que você fez. Tente de novo em alguns instantes; se continuar, fale com o suporte." }, "unknown": { "title": "Não conseguimos carregar esta parte", "description": "Isso costuma ser passageiro. Tente de novo e, se continuar assim, fale com o suporte contando o que você estava fazendo." } };
31
31
  const sidebar = { "home": "Início", "logout": "Sair", "openSidebar": "Abrir barra lateral", "collapseSidebar": "Recolher barra lateral", "favorites": { "add": "Adicionar aos favoritos", "remove": "Remover dos favoritos" }, "sections": { "favorites": "Favoritos", "management": "Gestão", "registration": "Cadastros" } };
32
- const theme = { "toggle": "Tema", "light": "Tema claro", "dark": "Tema escuro", "system": "Seguir o sistema", "halloween": "Tema de Halloween" };
32
+ const theme = { "toggle": "Tema", "light": "Tema claro", "dark": "Tema escuro", "system": "Seguir o sistema", "halloween": "Tema de Halloween", "christmas": "Tema de Natal" };
33
33
  const toast = { "learnMore": "Saiba Mais" };
34
34
  const unifiedSearchBar = { "clearFilter": "Limpar Filtro" };
35
35
  const uploader = { "dragOr": "Arraste ou", "selectFile": "selecione um arquivo", "orPaste": "ou cole (Ctrl+V)", "allowedFormats": "Formatos permitidos:", "upTo": "até", "megabytesSuffix": "MB", "sendFiles": "Enviar arquivo(s)", "filesIgnoredMaxSize": "Alguns arquivos foram ignorados porque excederam o tamanho máximo de {{size}}MB", "invalidFormat": "Por favor, insira arquivos nos formatos permitidos", "allowedFormatsTooltip": "Formatos permitidos: {{formats}} até {{size}}MB", "anyFormatUpTo": "Qualquer formato até {{size}} MB", "filesBlocked": "Este tipo de arquivo não é aceito: {{files}}.", "filesOverMaxSize": "Passou do limite de {{size}} MB: {{files}}." };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umodeapporg/ui",
3
- "version": "0.37.0",
3
+ "version": "0.38.0",
4
4
  "license": "UNLICENSED",
5
5
  "type": "module",
6
6
  "sideEffects": [
@@ -329,6 +329,43 @@
329
329
  --color-chart-3: 180 124 245;
330
330
  }
331
331
 
332
+ /* Christmas: an evergreen brand, cranberry in accent and gold in the ring.
333
+ - The brand is a deep PINE, not red. The `purple` chip tone and every primary button
334
+ follow the brand, and a red brand would paint a "Salvar" button and a tag like an error.
335
+ Pine still takes white ink, like the Halloween orange, so brand buttons keep their icons.
336
+ - `success` leaves emerald for a yellow-green. With a pine brand, a success chip and a
337
+ brand chip would read as the same thing, and a status must never look like decoration.
338
+ - Gold lives in `ring`, which is never a text background: focus, and the glow of the
339
+ decoration. Cranberry lives in `accent`, whose ink turns white because it is dark.
340
+ - The chart palette only swaps series 1 and 6, so the first series follows the brand and
341
+ the set the audit already separated stays the same set. */
342
+ :root[data-theme='dark'][data-theme-skin='christmas'] {
343
+ --color-ring: 236 190 80;
344
+ --color-selection: 22 90 66;
345
+ --color-selection-fg: 237 237 237;
346
+ --color-primary: 20 120 84;
347
+ --color-primary-hover: 24 130 91;
348
+ --color-primary-active: 28 138 97;
349
+ --color-primary-soft: 12 42 31;
350
+ --color-primary-soft-hover: 16 54 40;
351
+ --color-primary-emphasis: 118 214 172;
352
+ --color-primary-border: 26 76 57;
353
+ --color-accent: 208 52 76;
354
+ --color-accent-hover: 212 56 80;
355
+ --color-accent-fg: 255 255 255;
356
+ --color-accent-soft: 64 20 32;
357
+ --color-accent-emphasis: 240 128 142;
358
+ --color-accent-border: 98 30 44;
359
+ --color-success: 116 196 64;
360
+ --color-success-hover: 134 210 84;
361
+ --color-success-fg: 18 34 4;
362
+ --color-success-soft: 26 44 14;
363
+ --color-success-emphasis: 164 224 112;
364
+ --color-success-border: 52 80 26;
365
+ --color-chart-1: 74 222 128;
366
+ --color-chart-6: 180 124 245;
367
+ }
368
+
332
369
  /* Zero-flash safety net. The inline boot script in index.html always resolves the
333
370
  preference to a concrete data-theme before first paint, so this block only
334
371
  matters in the window before that script runs (or if it ever fails to). */