origam 2.23.2 → 2.25.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.
Files changed (44) hide show
  1. package/CHANGELOG.md +52 -0
  2. package/dist/src/assets/css/main.css +1 -1
  3. package/dist/src/assets/css/tokens/dark.css +24 -22
  4. package/dist/src/assets/css/tokens/light.css +12 -11
  5. package/dist/src/assets/css/tokens/origam-utilities.css +84 -0
  6. package/dist/src/assets/css/tokens/primitive.css +1 -0
  7. package/dist/src/assets/scss/tokens/_dark.scss +24 -22
  8. package/dist/src/assets/scss/tokens/_light.scss +12 -11
  9. package/dist/src/assets/scss/tokens/_origam-utilities.scss +84 -0
  10. package/dist/src/assets/scss/tokens/_primitive.scss +1 -0
  11. package/dist/src/components/Btn/OrigamBtn.vue +89 -124
  12. package/dist/src/components/Field/OrigamField.vue +120 -152
  13. package/dist/src/components/Skeleton/OrigamSkeleton.vue +89 -125
  14. package/dist/src/components/Skeleton/OrigamSkeletonGroup.vue +52 -0
  15. package/dist/src/components/Skeleton/index.cjs +7 -0
  16. package/dist/src/components/Skeleton/index.d.ts +1 -0
  17. package/dist/src/components/Skeleton/index.js +1 -0
  18. package/dist/src/components/Switch/OrigamSwitch.vue +1 -69
  19. package/dist/src/consts/Skeleton/skeleton.const.cjs +7 -0
  20. package/dist/src/consts/Skeleton/skeleton.const.d.ts +11 -0
  21. package/dist/src/consts/Skeleton/skeleton.const.js +1 -0
  22. package/dist/src/consts/index.cjs +11 -0
  23. package/dist/src/consts/index.d.ts +1 -0
  24. package/dist/src/consts/index.js +1 -0
  25. package/dist/src/enums/Skeleton/skeleton.enum.cjs +9 -2
  26. package/dist/src/enums/Skeleton/skeleton.enum.d.ts +27 -4
  27. package/dist/src/enums/Skeleton/skeleton.enum.js +7 -0
  28. package/dist/src/interfaces/Btn/btn.interface.d.ts +3 -3
  29. package/dist/src/interfaces/Commons/loader.interface.d.ts +13 -1
  30. package/dist/src/interfaces/Field/field.interface.d.ts +2 -2
  31. package/dist/src/interfaces/Skeleton/skeleton-group.interface.cjs +1 -0
  32. package/dist/src/interfaces/Skeleton/skeleton-group.interface.d.ts +34 -0
  33. package/dist/src/interfaces/Skeleton/skeleton-group.interface.js +0 -0
  34. package/dist/src/interfaces/Skeleton/skeleton.interface.d.ts +27 -10
  35. package/dist/src/interfaces/Switch/switch.interface.d.ts +2 -2
  36. package/dist/src/interfaces/index.cjs +11 -0
  37. package/dist/src/interfaces/index.d.ts +1 -0
  38. package/dist/src/interfaces/index.js +1 -0
  39. package/dist/src/themes/origam.theme.cjs +2 -4
  40. package/dist/src/themes/origam.theme.js +2 -2
  41. package/dist/src/types/Commons/loader.type.d.ts +24 -0
  42. package/dist/src/types/Skeleton/skeleton.type.d.ts +4 -1
  43. package/dist/src/types/tokens.type.d.ts +1 -1
  44. package/package.json +1 -1
@@ -9,7 +9,7 @@ import type { IElevationProps } from '../Commons/elevation.interface';
9
9
  import type { IGroupEmits, IGroupItemProps } from '../Commons/group.interface';
10
10
  import type { IHoverProps } from '../Commons/hover.interface';
11
11
  import type { ILinkProps } from '../Commons/router.interface';
12
- import type { ILoaderProps } from '../Commons/loader.interface';
12
+ import type { IControlLoaderProps } from '../Commons/loader.interface';
13
13
  import type { ILocationProps } from '../Commons/location.interface';
14
14
  import type { IMarginProps } from '../Commons/margin.interface';
15
15
  import type { IPaddingProps } from '../Commons/padding.interface';
@@ -25,7 +25,7 @@ import type { TStatus, TStatusPosition } from '../../types/Commons/status.type';
25
25
  * `icon` prop accepts `boolean | TIcon` (boolean = icon-only mode) which is
26
26
  * wider than `IIconProps.icon?: TIcon`. Pulling the two status props in
27
27
  * directly avoids the TS2430 incompatible-extends error. */
28
- export interface IBtnProps extends ICommonsComponentProps, IColorProps, IBgColorProps, IBorderProps, IDensityProps, IDimensionProps, IElevationProps, IRoundedProps, ITagProps, ISizeProps, ILinkProps, IRippleProps, ILoaderProps, IPositionProps, ILocationProps, IGroupItemProps, IPaddingProps, IMarginProps, IAdjacentProps, IHoverProps, IActiveProps, IActionVariantProps, Pick<ITypographyProps, 'fontSize' | 'fontWeight' | 'lineHeight' | 'letterSpacing'> {
28
+ export interface IBtnProps extends ICommonsComponentProps, IColorProps, IBgColorProps, IBorderProps, IDensityProps, IDimensionProps, IElevationProps, IRoundedProps, ITagProps, ISizeProps, ILinkProps, IRippleProps, IControlLoaderProps, IPositionProps, ILocationProps, IGroupItemProps, IPaddingProps, IMarginProps, IAdjacentProps, IHoverProps, IActiveProps, IActionVariantProps, Pick<ITypographyProps, 'fontSize' | 'fontWeight' | 'lineHeight' | 'letterSpacing'> {
29
29
  /** @deprecated Use `variant="flat"` instead. Kept for backward compat. */
30
30
  flat?: boolean;
31
31
  /** Pass `true` to activate icon-only mode; pass a `TIcon` value to set the icon. */
@@ -62,7 +62,7 @@ export interface IBtnEmits extends IGroupEmits {
62
62
  export interface IBtnSlots extends IAdjacentSlots {
63
63
  /** Overrides the whole loader/prepend/content/append layout. */
64
64
  wrapper?: () => any;
65
- /** Overrides the active loader (line/circular/skeleton), receives the
65
+ /** Overrides the active loader (line/circular), receives the
66
66
  * forwarded `<OrigamProgress>` props. */
67
67
  loader?: (data: Record<string, unknown>) => any;
68
68
  default?: () => any;
@@ -1,6 +1,6 @@
1
1
  import type { IColorProps } from './color.interface';
2
2
  import type { ICommonsComponentProps, ITagProps } from './commons.interface';
3
- import type { TLoaderConfig, TLoaderKind, TLoadingValue } from '../../types/Commons/loader.type';
3
+ import type { TControlLoadingValue, TLoaderConfig, TLoaderKind, TLoadingValue } from '../../types/Commons/loader.type';
4
4
  /*********************************************************
5
5
  * ILoaderProps / IResolvedLoader
6
6
  *
@@ -20,6 +20,18 @@ export interface ILoaderProps extends ICommonsComponentProps, ITagProps, IColorP
20
20
  loading?: TLoadingValue;
21
21
  loadingText?: string;
22
22
  }
23
+ /*********************************************************
24
+ * IControlLoaderProps
25
+ *
26
+ * @description
27
+ * `ILoaderProps` for a CONTROL (`OrigamBtn`, `OrigamSwitch`, `OrigamField`
28
+ * and its derivatives): same surface, but `loading` refuses
29
+ * `{ type: 'skeleton' }` - an action in flight never replaces the control
30
+ * (see `TControlLoaderConfig`).
31
+ ********************************************************/
32
+ export interface IControlLoaderProps extends Omit<ILoaderProps, 'loading'> {
33
+ loading?: TControlLoadingValue;
34
+ }
23
35
  /**
24
36
  * Resolved loader state — what each consumer component reads to decide
25
37
  * which renderer to mount and with which props.
@@ -7,7 +7,7 @@ import type { IDensityProps } from '../Commons/density.interface';
7
7
  import type { IElevationProps } from '../Commons/elevation.interface';
8
8
  import type { IFocusEmits, IFocusProps } from '../Commons/focus.interface';
9
9
  import type { ILabelProps } from '../Label/label.interface';
10
- import type { ILoaderProps } from '../Commons/loader.interface';
10
+ import type { IControlLoaderProps } from '../Commons/loader.interface';
11
11
  import type { IRoundedProps } from '../Commons/rounded.interface';
12
12
  import type { ISizeProps } from '../Commons/size.interface';
13
13
  import type { ITypographyProps } from '../Commons/typography.interface';
@@ -31,7 +31,7 @@ import type { IInputVariantProps } from '../Commons/variant.interface';
31
31
  * `--origam-field---border-*` token channel the three outline legs already
32
32
  * read, so the notch keeps opening under `--active` / `--focused`.
33
33
  ********************************************************/
34
- export interface IFieldProps extends ICommonsComponentProps, ILoaderProps, IColorProps, IBgColorProps, IAdjacentInnerProps, IBorderProps, IFocusProps, IDensityProps, ILabelProps, IActiveProps, IInputVariantProps, IRoundedProps, IElevationProps, ISizeProps, Pick<ITypographyProps, 'fontSize' | 'fontWeight' | 'lineHeight' | 'letterSpacing'> {
34
+ export interface IFieldProps extends ICommonsComponentProps, IControlLoaderProps, IColorProps, IBgColorProps, IAdjacentInnerProps, IBorderProps, IFocusProps, IDensityProps, ILabelProps, IActiveProps, IInputVariantProps, IRoundedProps, IElevationProps, ISizeProps, Pick<ITypographyProps, 'fontSize' | 'fontWeight' | 'lineHeight' | 'letterSpacing'> {
35
35
  centerAffix?: boolean;
36
36
  dirty?: boolean;
37
37
  disabled?: boolean;
@@ -0,0 +1,34 @@
1
+ import type { ComputedRef } from 'vue';
2
+ import type { ICommonsComponentProps } from '../Commons/commons.interface';
3
+ import type { TSkeletonAnimation } from '../../types/Skeleton/skeleton.type';
4
+ export interface ISkeletonGroupProps extends ICommonsComponentProps {
5
+ /*********************************************************
6
+ * animation
7
+ *
8
+ * @description
9
+ * One animation clock for the whole group. `pulse` (default) animates
10
+ * the group container itself, so blocks that mount at different moments
11
+ * still breathe together. `wave` lets each block sweep its own shimmer.
12
+ * `none` is static. Blocks inherit it unless they set their own.
13
+ ********************************************************/
14
+ animation?: TSkeletonAnimation;
15
+ /*********************************************************
16
+ * label
17
+ *
18
+ * @description
19
+ * Locale key of the ONE announcement made for the whole zone
20
+ * (`role="status"`, `aria-busy="true"`). Defaults to `'origam.loading'`.
21
+ ********************************************************/
22
+ label?: string;
23
+ }
24
+ /*********************************************************
25
+ * ISkeletonGroupProvide
26
+ *
27
+ * @description
28
+ * Shape provided to the blocks of a group.
29
+ ********************************************************/
30
+ export interface ISkeletonGroupProvide {
31
+ animation: ComputedRef<TSkeletonAnimation>;
32
+ }
33
+ export interface ISkeletonGroupEmits {
34
+ }
@@ -1,27 +1,44 @@
1
1
  import type { IBgColorProps, IColorProps } from '../Commons/color.interface';
2
2
  import type { ICommonsComponentProps } from '../Commons/commons.interface';
3
+ import type { IDimensionProps } from '../Commons/dimension.interface';
3
4
  import type { IRoundedProps } from '../Commons/rounded.interface';
4
5
  import type { ISizeProps } from '../Commons/size.interface';
5
- import type { TSkeletonVariant } from '../../types/Skeleton/skeleton.type';
6
- export interface ISkeletonProps extends ICommonsComponentProps, IColorProps, IBgColorProps, ISizeProps, IRoundedProps {
6
+ import type { TSkeletonAnimation, TSkeletonVariant } from '../../types/Skeleton/skeleton.type';
7
+ export interface ISkeletonProps extends ICommonsComponentProps, IColorProps, IBgColorProps, ISizeProps, IRoundedProps, IDimensionProps {
7
8
  variant?: TSkeletonVariant;
8
- width?: string | number;
9
- height?: string | number;
10
9
  loading?: boolean;
11
- pulse?: boolean;
10
+ /*********************************************************
11
+ * animation
12
+ *
13
+ * @description
14
+ * How the placeholder moves: `pulse` (default — an opacity breath),
15
+ * `wave` (a shimmer sweeping across) or `none`. Left unset, a block
16
+ * follows the `<OrigamSkeletonGroup>` it sits in, and falls back to
17
+ * `pulse` outside any group.
18
+ *
19
+ * @description
20
+ * Every animation stops after a finite number of loops
21
+ * (`--origam-skeleton---animation-iterations`, ~10 s) and is switched
22
+ * off under `prefers-reduced-motion: reduce` (WCAG 2.2.2).
23
+ ********************************************************/
24
+ animation?: TSkeletonAnimation;
12
25
  /*********************************************************
13
26
  * label
14
27
  *
15
28
  * @description
16
- * Accessible label announced on the `role="status"` placeholder
17
- * (aria-label). Carries a LOCALE KEY, not final text — it is resolved
18
- * through the DS `t()` mechanism, so it follows the active locale out
19
- * of the box. Defaults to `'origam.loading'`, the shared key also used
20
- * by Progress / Video / Audio / Switch for this same announcement.
29
+ * Accessible label announced on a STANDALONE placeholder
30
+ * (`role="status"` + `aria-label`). Carries a LOCALE KEY, not final
31
+ * text — it is resolved through the DS `t()` mechanism, so it follows
32
+ * the active locale out of the box. Defaults to `'origam.loading'`, the
33
+ * shared key also used by Progress / Video / Audio / Switch for this
34
+ * same announcement.
21
35
  * @description
22
36
  * A raw string that matches no key is returned unchanged, so
23
37
  * `label="Loading your invoices"` still works for consumers who prefer
24
38
  * to translate on their side.
39
+ * @description
40
+ * Ignored inside an `<OrigamSkeletonGroup>`: the group owns the one
41
+ * announcement and its blocks are `aria-hidden`.
25
42
  ********************************************************/
26
43
  label?: string;
27
44
  }
@@ -7,13 +7,13 @@ import type { IElevationProps } from '../Commons/elevation.interface';
7
7
  import type { IFocusEmits } from '../Commons/focus.interface';
8
8
  import type { IHoverProps } from '../Commons/hover.interface';
9
9
  import type { IInputProps } from '../Input/input.interface';
10
- import type { ILoaderProps } from '../Commons/loader.interface';
10
+ import type { IControlLoaderProps } from '../Commons/loader.interface';
11
11
  import type { IMarginProps } from '../Commons/margin.interface';
12
12
  import type { IPaddingProps } from '../Commons/padding.interface';
13
13
  import type { IRoundedProps } from '../Commons/rounded.interface';
14
14
  import type { ISelectionControlProps } from '../SelectionControl/selection-control.interface';
15
15
  import type { ISwitchTrackSlotsProps } from './switch-track.interface';
16
- export interface ISwitchProps extends ICommonsComponentProps, ITagProps, IPaddingProps, IMarginProps, IBorderProps, IRoundedProps, IInputProps, ISelectionControlProps, ILoaderProps, IColorProps, IDensityProps, IElevationProps, IActiveProps, IHoverProps {
16
+ export interface ISwitchProps extends ICommonsComponentProps, ITagProps, IPaddingProps, IMarginProps, IBorderProps, IRoundedProps, IInputProps, ISelectionControlProps, IControlLoaderProps, IColorProps, IDensityProps, IElevationProps, IActiveProps, IHoverProps {
17
17
  indeterminate?: boolean;
18
18
  inset?: boolean;
19
19
  }
@@ -2709,6 +2709,17 @@ Object.keys(_skeleton).forEach(function (key) {
2709
2709
  }
2710
2710
  });
2711
2711
  });
2712
+ var _skeletonGroup = require("./Skeleton/skeleton-group.interface.cjs");
2713
+ Object.keys(_skeletonGroup).forEach(function (key) {
2714
+ if (key === "default" || key === "__esModule") return;
2715
+ if (key in exports && exports[key] === _skeletonGroup[key]) return;
2716
+ Object.defineProperty(exports, key, {
2717
+ enumerable: true,
2718
+ get: function () {
2719
+ return _skeletonGroup[key];
2720
+ }
2721
+ });
2722
+ });
2712
2723
  var _kbd = require("./Kbd/kbd.interface.cjs");
2713
2724
  Object.keys(_kbd).forEach(function (key) {
2714
2725
  if (key === "default" || key === "__esModule") return;
@@ -244,6 +244,7 @@ export * from './VirtualScroll/virtual-scroll-item.interface';
244
244
  export * from './Window/window.interface';
245
245
  export * from './Window/window-item.interface';
246
246
  export * from './Skeleton/skeleton.interface';
247
+ export * from './Skeleton/skeleton-group.interface';
247
248
  export * from './Kbd/kbd.interface';
248
249
  export * from './Stepper/stepper.interface';
249
250
  export * from './Stepper/stepper-item.interface';
@@ -244,6 +244,7 @@ export * from "./VirtualScroll/virtual-scroll-item.interface.js";
244
244
  export * from "./Window/window.interface.js";
245
245
  export * from "./Window/window-item.interface.js";
246
246
  export * from "./Skeleton/skeleton.interface.js";
247
+ export * from "./Skeleton/skeleton-group.interface.js";
247
248
  export * from "./Kbd/kbd.interface.js";
248
249
  export * from "./Stepper/stepper.interface.js";
249
250
  export * from "./Stepper/stepper-item.interface.js";
@@ -402,8 +402,7 @@ const origamLightTheme = exports.origamLightTheme = {
402
402
  borderColor: "var(--origam-color__border---default)"
403
403
  },
404
404
  "origam-skeleton": {
405
- variant: "text",
406
- rounded: "sm"
405
+ variant: "text"
407
406
  },
408
407
  "origam-slider-field": {
409
408
  variant: "field"
@@ -817,8 +816,7 @@ const origamDarkTheme = exports.origamDarkTheme = {
817
816
  borderColor: "var(--origam-color__border---default)"
818
817
  },
819
818
  "origam-skeleton": {
820
- variant: "text",
821
- rounded: "sm"
819
+ variant: "text"
822
820
  },
823
821
  "origam-slider-field": {
824
822
  variant: "field"
@@ -207,7 +207,7 @@ export const origamLightTheme = {
207
207
  "origam-rating-field": { tag: "div", size: "default" },
208
208
  "origam-select": { border: true, rounded: true, variant: "outlined", density: "compact" },
209
209
  "origam-sheet": { border: true, borderColor: "var(--origam-color__border---default)" },
210
- "origam-skeleton": { variant: "text", rounded: "sm" },
210
+ "origam-skeleton": { variant: "text" },
211
211
  "origam-slider-field": { variant: "field" },
212
212
  "origam-snackbar": { location: "bottom", border: true, rounded: true, elevation: 1 },
213
213
  "origam-stepper": { size: "default" },
@@ -377,7 +377,7 @@ export const origamDarkTheme = {
377
377
  "origam-rating-field": { tag: "div", size: "default" },
378
378
  "origam-select": { border: true, rounded: true, variant: "outlined", density: "compact" },
379
379
  "origam-sheet": { border: true, borderColor: "var(--origam-color__border---default)" },
380
- "origam-skeleton": { variant: "text", rounded: "sm" },
380
+ "origam-skeleton": { variant: "text" },
381
381
  "origam-slider-field": { variant: "field" },
382
382
  "origam-snackbar": { location: "bottom", border: true, rounded: true, elevation: 1 },
383
383
  "origam-stepper": { size: "default" },
@@ -35,3 +35,27 @@ export type TLoaderConfig = ({
35
35
  * | `{ type: 'line' \| 'circular' \| 'skeleton', … }` | Loading with explicit kind override and per-instance prop overrides. |
36
36
  */
37
37
  export type TLoadingValue = boolean | number | TLoaderConfig;
38
+ /*********************************************************
39
+ * TControlLoaderConfig / TControlLoadingValue
40
+ *
41
+ * @description
42
+ * Per-kind override config of a CONTROL (`OrigamBtn`, `OrigamSwitch`,
43
+ * `OrigamField` and its derivatives). A control that is mid-action keeps its
44
+ * label, its value and its input rendered: an action in flight is signalled
45
+ * by an indicator (spinner / strip), never by a placeholder that stands in
46
+ * for the control.
47
+ *
48
+ * @description
49
+ * So the `skeleton` member of `TLoaderConfig` is REFUSED at compile time
50
+ * here: `{ type: 'skeleton' }` is a type error on these components.
51
+ * Skeleton placeholders stay available on the containers whose content
52
+ * genuinely does not exist yet (Card, ExpansionPanel, DataTable).
53
+ *
54
+ * @description
55
+ * `TControlLoadingValue` is the `loading` prop value a control accepts:
56
+ * `TLoadingValue` minus the skeleton placeholder.
57
+ ********************************************************/
58
+ export type TControlLoaderConfig = Exclude<TLoaderConfig, {
59
+ type: `${LOADER_KIND.SKELETON}`;
60
+ }>;
61
+ export type TControlLoadingValue = boolean | number | TControlLoaderConfig;
@@ -1,4 +1,7 @@
1
1
  import OrigamSkeleton from '../../components/Skeleton/OrigamSkeleton.vue';
2
- import { SKELETON_VARIANT } from '../../enums/Skeleton/skeleton.enum';
2
+ import OrigamSkeletonGroup from '../../components/Skeleton/OrigamSkeletonGroup.vue';
3
+ import { SKELETON_ANIMATION, SKELETON_VARIANT } from '../../enums/Skeleton/skeleton.enum';
3
4
  export type TOrigamSkeleton = InstanceType<typeof OrigamSkeleton>;
5
+ export type TOrigamSkeletonGroup = InstanceType<typeof OrigamSkeletonGroup>;
4
6
  export type TSkeletonVariant = `${SKELETON_VARIANT}`;
7
+ export type TSkeletonAnimation = `${SKELETON_ANIMATION}`;