origam 2.18.19 → 2.18.20
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/CHANGELOG.md +41 -0
- package/dist/src/assets/css/main.css +1 -1
- package/dist/src/assets/css/tokens/origam-utilities.css +30 -0
- package/dist/src/assets/css/tokens/primitive.css +5 -0
- package/dist/src/assets/scss/tokens/_origam-utilities.scss +30 -0
- package/dist/src/assets/scss/tokens/_primitive.scss +5 -0
- package/dist/src/composables/Commons/backdrop.composable.cjs +50 -0
- package/dist/src/composables/Commons/backdrop.composable.d.ts +32 -0
- package/dist/src/composables/Commons/backdrop.composable.js +33 -0
- package/dist/src/composables/Commons/opacity.composable.cjs +50 -0
- package/dist/src/composables/Commons/opacity.composable.d.ts +33 -0
- package/dist/src/composables/Commons/opacity.composable.js +34 -0
- package/dist/src/composables/Commons/stateEffect.composable.cjs +17 -2
- package/dist/src/composables/Commons/stateEffect.composable.d.ts +7 -2
- package/dist/src/composables/Commons/stateEffect.composable.js +23 -2
- package/dist/src/composables/index.cjs +24 -0
- package/dist/src/composables/index.d.ts +2 -0
- package/dist/src/composables/index.js +2 -0
- package/dist/src/consts/Commons/backdrop.const.cjs +15 -0
- package/dist/src/consts/Commons/backdrop.const.d.ts +47 -0
- package/dist/src/consts/Commons/backdrop.const.js +9 -0
- package/dist/src/consts/Commons/opacity.const.cjs +20 -0
- package/dist/src/consts/Commons/opacity.const.d.ts +58 -0
- package/dist/src/consts/Commons/opacity.const.js +14 -0
- package/dist/src/consts/index.cjs +22 -0
- package/dist/src/consts/index.d.ts +2 -0
- package/dist/src/consts/index.js +2 -0
- package/dist/src/interfaces/Commons/backdrop.interface.cjs +1 -0
- package/dist/src/interfaces/Commons/backdrop.interface.d.ts +49 -0
- package/dist/src/interfaces/Commons/backdrop.interface.js +0 -0
- package/dist/src/interfaces/Commons/opacity.interface.cjs +1 -0
- package/dist/src/interfaces/Commons/opacity.interface.d.ts +37 -0
- package/dist/src/interfaces/Commons/opacity.interface.js +0 -0
- package/dist/src/interfaces/Commons/state-effect.interface.d.ts +31 -0
- package/dist/src/interfaces/index.cjs +22 -0
- package/dist/src/interfaces/index.d.ts +2 -0
- package/dist/src/interfaces/index.js +2 -0
- package/dist/src/types/Commons/backdrop.type.cjs +1 -0
- package/dist/src/types/Commons/backdrop.type.d.ts +23 -0
- package/dist/src/types/Commons/backdrop.type.js +0 -0
- package/dist/src/types/Commons/opacity.type.cjs +1 -0
- package/dist/src/types/Commons/opacity.type.d.ts +36 -0
- package/dist/src/types/Commons/opacity.type.js +0 -0
- package/dist/src/types/Commons/state-effect.type.d.ts +2 -1
- package/dist/src/types/index.cjs +22 -0
- package/dist/src/types/index.d.ts +2 -0
- package/dist/src/types/index.js +2 -0
- package/dist/src/types/tokens.type.d.ts +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/*********************************************************
|
|
2
|
+
* OPACITY_RUNG_VARS
|
|
3
|
+
*
|
|
4
|
+
* @description
|
|
5
|
+
* The 0..100 percent rungs of the primitive opacity ladder, mapped to the
|
|
6
|
+
* `var()` expression `useOpacity` emits for each. Keys are the rung names
|
|
7
|
+
* as they appear in the token suffix and in the utility class.
|
|
8
|
+
*
|
|
9
|
+
* @description
|
|
10
|
+
* ⛔ WRITTEN AS WHOLE LITERAL STRINGS ON PURPOSE, not assembled from a
|
|
11
|
+
* prefix plus the key. `token-var-channels` scans `.ts` sources for the
|
|
12
|
+
* literal text `var(--origam-…)` to decide whether a declared token is
|
|
13
|
+
* read by anybody; a name concatenated at runtime
|
|
14
|
+
* (`var(${PREFIX}${rung})`) matches nothing, so every rung here would be
|
|
15
|
+
* reported DORMANT and the guard would redden. That is the same blind
|
|
16
|
+
* spot #813 shipped through and #823 exists to close — see the
|
|
17
|
+
* `SHADOW_TOKEN_PREFIX` banner in `elevation.const.ts` for the version of
|
|
18
|
+
* this trap that already cost the repo a release.
|
|
19
|
+
*
|
|
20
|
+
* @description
|
|
21
|
+
* Each reference carries a literal fallback, the shape CLAUDE.md names as
|
|
22
|
+
* the one to copy (`useRounded`'s `var(--origam-radius---md, 8px)`). The
|
|
23
|
+
* ladder is declared in `primitive.css` / `_primitive.scss`, so the
|
|
24
|
+
* fallback is inert today; it stops the declaration from being destroyed
|
|
25
|
+
* outright should a consumer ship the component CSS without the token
|
|
26
|
+
* sheet.
|
|
27
|
+
********************************************************/
|
|
28
|
+
export declare const OPACITY_RUNG_VARS: Readonly<Record<string, string>>;
|
|
29
|
+
/*********************************************************
|
|
30
|
+
* OPACITY_UTILITY_CLASS_PREFIX
|
|
31
|
+
*
|
|
32
|
+
* @description
|
|
33
|
+
* Root of the global opacity utility classes emitted by `useOpacity`
|
|
34
|
+
* (`.origam--opacity-70`, ...). Declared in
|
|
35
|
+
* `src/assets/css/tokens/origam-utilities.css`.
|
|
36
|
+
********************************************************/
|
|
37
|
+
export declare const OPACITY_UTILITY_CLASS_PREFIX = "origam--opacity-";
|
|
38
|
+
/*********************************************************
|
|
39
|
+
* OPACITY_FRACTION_CEILING
|
|
40
|
+
*
|
|
41
|
+
* @description
|
|
42
|
+
* Boundary between the two numeric readings of `TOpacity`. A value at or
|
|
43
|
+
* below it is a CSS fraction; above it, a 0..100 percentage.
|
|
44
|
+
*
|
|
45
|
+
* @description
|
|
46
|
+
* Named rather than inlined so the one place that decides `opacity={1}`
|
|
47
|
+
* means "opaque" and not "1 %" is greppable — see {@link TOpacity} for
|
|
48
|
+
* why that call was made.
|
|
49
|
+
********************************************************/
|
|
50
|
+
export declare const OPACITY_FRACTION_CEILING = 1;
|
|
51
|
+
/*********************************************************
|
|
52
|
+
* OPACITY_PERCENT_SCALE
|
|
53
|
+
*
|
|
54
|
+
* @description
|
|
55
|
+
* Divisor turning a percent-scale `opacity` into the CSS fraction it
|
|
56
|
+
* denotes, for the values that name no token rung (`42` -> `0.42`).
|
|
57
|
+
********************************************************/
|
|
58
|
+
export declare const OPACITY_PERCENT_SCALE = 100;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export const OPACITY_RUNG_VARS = {
|
|
2
|
+
"0": "var(--origam-opacity---0, 0)",
|
|
3
|
+
"12": "var(--origam-opacity---12, 0.12)",
|
|
4
|
+
"26": "var(--origam-opacity---26, 0.26)",
|
|
5
|
+
"32": "var(--origam-opacity---32, 0.32)",
|
|
6
|
+
"50": "var(--origam-opacity---50, 0.5)",
|
|
7
|
+
"60": "var(--origam-opacity---60, 0.6)",
|
|
8
|
+
"70": "var(--origam-opacity---70, 0.7)",
|
|
9
|
+
"87": "var(--origam-opacity---87, 0.87)",
|
|
10
|
+
"100": "var(--origam-opacity---100, 1)"
|
|
11
|
+
};
|
|
12
|
+
export const OPACITY_UTILITY_CLASS_PREFIX = "origam--opacity-";
|
|
13
|
+
export const OPACITY_FRACTION_CEILING = 1;
|
|
14
|
+
export const OPACITY_PERCENT_SCALE = 100;
|
|
@@ -949,6 +949,17 @@ Object.keys(_cssSupport).forEach(function (key) {
|
|
|
949
949
|
}
|
|
950
950
|
});
|
|
951
951
|
});
|
|
952
|
+
var _backdrop = require("./Commons/backdrop.const.cjs");
|
|
953
|
+
Object.keys(_backdrop).forEach(function (key) {
|
|
954
|
+
if (key === "default" || key === "__esModule") return;
|
|
955
|
+
if (key in exports && exports[key] === _backdrop[key]) return;
|
|
956
|
+
Object.defineProperty(exports, key, {
|
|
957
|
+
enumerable: true,
|
|
958
|
+
get: function () {
|
|
959
|
+
return _backdrop[key];
|
|
960
|
+
}
|
|
961
|
+
});
|
|
962
|
+
});
|
|
952
963
|
var _elevation = require("./Commons/elevation.const.cjs");
|
|
953
964
|
Object.keys(_elevation).forEach(function (key) {
|
|
954
965
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -960,6 +971,17 @@ Object.keys(_elevation).forEach(function (key) {
|
|
|
960
971
|
}
|
|
961
972
|
});
|
|
962
973
|
});
|
|
974
|
+
var _opacity = require("./Commons/opacity.const.cjs");
|
|
975
|
+
Object.keys(_opacity).forEach(function (key) {
|
|
976
|
+
if (key === "default" || key === "__esModule") return;
|
|
977
|
+
if (key in exports && exports[key] === _opacity[key]) return;
|
|
978
|
+
Object.defineProperty(exports, key, {
|
|
979
|
+
enumerable: true,
|
|
980
|
+
get: function () {
|
|
981
|
+
return _opacity[key];
|
|
982
|
+
}
|
|
983
|
+
});
|
|
984
|
+
});
|
|
963
985
|
var _variantPreset = require("./Commons/variant-preset.const.cjs");
|
|
964
986
|
Object.keys(_variantPreset).forEach(function (key) {
|
|
965
987
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -84,5 +84,7 @@ export * from './Audio/audio.const';
|
|
|
84
84
|
export * from './Audio/audio-waveform.const';
|
|
85
85
|
export * from './Clipboard/clipboard.const';
|
|
86
86
|
export * from './Commons/css-support.const';
|
|
87
|
+
export * from './Commons/backdrop.const';
|
|
87
88
|
export * from './Commons/elevation.const';
|
|
89
|
+
export * from './Commons/opacity.const';
|
|
88
90
|
export * from './Commons/variant-preset.const';
|
package/dist/src/consts/index.js
CHANGED
|
@@ -84,5 +84,7 @@ export * from "./Audio/audio.const.js";
|
|
|
84
84
|
export * from "./Audio/audio-waveform.const.js";
|
|
85
85
|
export * from "./Clipboard/clipboard.const.js";
|
|
86
86
|
export * from "./Commons/css-support.const.js";
|
|
87
|
+
export * from "./Commons/backdrop.const.js";
|
|
87
88
|
export * from "./Commons/elevation.const.js";
|
|
89
|
+
export * from "./Commons/opacity.const.js";
|
|
88
90
|
export * from "./Commons/variant-preset.const.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { TBackdropBlur } from '../../types/Commons/backdrop.type';
|
|
2
|
+
/*********************************************************
|
|
3
|
+
* IBackdropProps
|
|
4
|
+
*
|
|
5
|
+
* @description
|
|
6
|
+
* Backdrop-filter surface — the "frosted glass" channel. Carries the blur
|
|
7
|
+
* rung only; it is not a general `filter` surface.
|
|
8
|
+
*
|
|
9
|
+
* @description
|
|
10
|
+
* ⛔ SCOPE, AND WHY IT STOPS HERE. ADR-005 Q1 was arbitrated as "a new
|
|
11
|
+
* prop surface" so `OrigamBtn`'s `ghost` variant can become a pure props
|
|
12
|
+
* preset instead of a `.origam-btn--variant-ghost` rule. What `ghost`
|
|
13
|
+
* needs is `backdrop-filter: blur(8px)` — that is the whole requirement,
|
|
14
|
+
* and this interface covers exactly it. `saturate()`, `brightness()` and
|
|
15
|
+
* multi-function filters are NOT guessed at here: a component that needs
|
|
16
|
+
* one keeps writing its own `--origam-{cmp}---backdrop-filter`, the
|
|
17
|
+
* channel 12 components already use today (Alert, Card, Chip, Field,
|
|
18
|
+
* Menu, Sheet, Snackbar, Tooltip, Toolbar, Overlay, CommandPalette, Btn).
|
|
19
|
+
*
|
|
20
|
+
* @description
|
|
21
|
+
* ⚠️ ADR-005 D6 recorded "no prop, no token group, no utility class" for
|
|
22
|
+
* this axis. Remeasured for this lot: the PROP and the UTILITY CLASS were
|
|
23
|
+
* indeed absent, but the per-component `---backdrop-filter` token channel
|
|
24
|
+
* above already existed. What was genuinely missing was a PRIMITIVE blur
|
|
25
|
+
* ladder, which this lot adds as `--origam-blur---{xs,sm,md,lg,xl}`.
|
|
26
|
+
*
|
|
27
|
+
* @description
|
|
28
|
+
* Consumed via `useBackdrop(props)` -> `{ backdropClasses, backdropStyles }`.
|
|
29
|
+
********************************************************/
|
|
30
|
+
export interface IBackdropProps {
|
|
31
|
+
/*********************************************************
|
|
32
|
+
* backdropBlur
|
|
33
|
+
*
|
|
34
|
+
* @description
|
|
35
|
+
* Blur radius applied to what sits BEHIND the element. A rung name
|
|
36
|
+
* (`'md'`) resolves to `blur(var(--origam-blur---md))`; `true` means
|
|
37
|
+
* the default rung; a number is read as `px`; any other string is
|
|
38
|
+
* emitted inside `blur(...)` verbatim.
|
|
39
|
+
*
|
|
40
|
+
* @description
|
|
41
|
+
* Emits `-webkit-backdrop-filter` alongside the standard property —
|
|
42
|
+
* Safari still needs the prefix. No `@supports` gate: an unsupported
|
|
43
|
+
* browser drops an unknown declaration on its own, and the
|
|
44
|
+
* `@supports not (...)` blocks in the DS today exist to thicken the
|
|
45
|
+
* BACKGROUND when blur is unavailable, which is a `bgColor` concern
|
|
46
|
+
* and not this one.
|
|
47
|
+
********************************************************/
|
|
48
|
+
backdropBlur?: TBackdropBlur;
|
|
49
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { TOpacity } from '../../types/Commons/opacity.type';
|
|
2
|
+
/*********************************************************
|
|
3
|
+
* IOpacityProps
|
|
4
|
+
*
|
|
5
|
+
* @description
|
|
6
|
+
* Opacity surface. Single scalar — there is no per-side or per-axis form,
|
|
7
|
+
* `opacity` being a whole-element property.
|
|
8
|
+
*
|
|
9
|
+
* @description
|
|
10
|
+
* ⛔ REUSE NOTE — this interface does NOT bring a token group with it. The
|
|
11
|
+
* primitive ladder it resolves against already existed before the
|
|
12
|
+
* interface did: `--origam-opacity---{0,12,26,32,50,60,70,87,100}`,
|
|
13
|
+
* declared in `assets/css/tokens/primitive.css` and its SCSS twin, and
|
|
14
|
+
* already read by `OrigamBtn`'s `--variant-plain` rule
|
|
15
|
+
* (`opacity: var(--origam-btn---opacity-plain, var(--origam-opacity---70))`).
|
|
16
|
+
* ADR-005's D6 proposed "add `IOpacityProps` + a token group"; only the
|
|
17
|
+
* first half was missing. Declaring a second ladder would have been the
|
|
18
|
+
* duplication the repo's reuse rule exists to prevent.
|
|
19
|
+
*
|
|
20
|
+
* @description
|
|
21
|
+
* Consumed via `useOpacity(props)` -> `{ opacityClasses, opacityStyles }`,
|
|
22
|
+
* both bound in parallel (strategy A) exactly as `useElevation` does.
|
|
23
|
+
********************************************************/
|
|
24
|
+
export interface IOpacityProps {
|
|
25
|
+
/*********************************************************
|
|
26
|
+
* opacity
|
|
27
|
+
*
|
|
28
|
+
* @description
|
|
29
|
+
* Element opacity. A number `<= 1` is a CSS fraction (`0.7`); a number
|
|
30
|
+
* `> 1` is a 0..100 percentage naming a token rung (`70`). Any other
|
|
31
|
+
* string passes through verbatim (`'50%'`, `'var(...)'`, `'calc(...)'`).
|
|
32
|
+
*
|
|
33
|
+
* @description
|
|
34
|
+
* See {@link TOpacity} for why the fraction/percent split sits at 1.
|
|
35
|
+
********************************************************/
|
|
36
|
+
opacity?: TOpacity;
|
|
37
|
+
}
|
|
File without changes
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { IBorderProps } from './border.interface';
|
|
2
2
|
import type { IElevationProps } from './elevation.interface';
|
|
3
3
|
import type { IMarginProps } from './margin.interface';
|
|
4
|
+
import type { IOpacityProps } from './opacity.interface';
|
|
4
5
|
import type { IPaddingProps } from './padding.interface';
|
|
5
6
|
import type { IRoundedProps } from './rounded.interface';
|
|
6
7
|
import type { TColor } from '../../types/Commons/color.type';
|
|
@@ -42,6 +43,23 @@ export interface IStateEffectConfig {
|
|
|
42
43
|
bgColor?: TColor;
|
|
43
44
|
/** Border width / style / direction override. */
|
|
44
45
|
border?: IBorderProps['border'];
|
|
46
|
+
/*********************************************************
|
|
47
|
+
* borderColor
|
|
48
|
+
*
|
|
49
|
+
* @description
|
|
50
|
+
* Border COLOUR override, independent of the `border` shorthand.
|
|
51
|
+
*
|
|
52
|
+
* @description
|
|
53
|
+
* ⚠️ ADR-005's D6 audit missed this one. It lists `opacity` as the
|
|
54
|
+
* single gap on this interface, having checked the variants that set
|
|
55
|
+
* a border WIDTH; `outlined --active` sets a border-COLOUR, which the
|
|
56
|
+
* `border` shorthand above cannot carry.
|
|
57
|
+
*
|
|
58
|
+
* @description
|
|
59
|
+
* Found by remeasuring D6 rather than by reading it, and recorded
|
|
60
|
+
* here because the ADR's own table is incomplete on this row.
|
|
61
|
+
********************************************************/
|
|
62
|
+
borderColor?: IBorderProps['borderColor'];
|
|
45
63
|
/** Corner radius override. */
|
|
46
64
|
rounded?: IRoundedProps['rounded'];
|
|
47
65
|
/** Box-shadow elevation override. */
|
|
@@ -52,6 +70,19 @@ export interface IStateEffectConfig {
|
|
|
52
70
|
margin?: IMarginProps['margin'];
|
|
53
71
|
/** Gap (flex/grid) override. Components that expose a `gap` prop pick it up. */
|
|
54
72
|
gap?: boolean | number | string;
|
|
73
|
+
/*********************************************************
|
|
74
|
+
* opacity
|
|
75
|
+
*
|
|
76
|
+
* @description
|
|
77
|
+
* Opacity override. This is the half of `OrigamBtn`'s `plain` variant
|
|
78
|
+
* that a preset could not express.
|
|
79
|
+
*
|
|
80
|
+
* @description
|
|
81
|
+
* `plain` is `opacity: var(--origam-opacity---70)` at rest plus
|
|
82
|
+
* `:hover { opacity: 1 }` — i.e. `{ opacity: 70, hover: { opacity: 100 } }`
|
|
83
|
+
* once this key exists (ADR-005 D6).
|
|
84
|
+
********************************************************/
|
|
85
|
+
opacity?: IOpacityProps['opacity'];
|
|
55
86
|
}
|
|
56
87
|
/**
|
|
57
88
|
* Hover-state configuration. Same shape as the generic state config —
|
|
@@ -542,6 +542,17 @@ Object.keys(_autocomplete).forEach(function (key) {
|
|
|
542
542
|
}
|
|
543
543
|
});
|
|
544
544
|
});
|
|
545
|
+
var _backdrop = require("./Commons/backdrop.interface.cjs");
|
|
546
|
+
Object.keys(_backdrop).forEach(function (key) {
|
|
547
|
+
if (key === "default" || key === "__esModule") return;
|
|
548
|
+
if (key in exports && exports[key] === _backdrop[key]) return;
|
|
549
|
+
Object.defineProperty(exports, key, {
|
|
550
|
+
enumerable: true,
|
|
551
|
+
get: function () {
|
|
552
|
+
return _backdrop[key];
|
|
553
|
+
}
|
|
554
|
+
});
|
|
555
|
+
});
|
|
545
556
|
var _border = require("./Commons/border.interface.cjs");
|
|
546
557
|
Object.keys(_border).forEach(function (key) {
|
|
547
558
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -927,6 +938,17 @@ Object.keys(_nested).forEach(function (key) {
|
|
|
927
938
|
}
|
|
928
939
|
});
|
|
929
940
|
});
|
|
941
|
+
var _opacity = require("./Commons/opacity.interface.cjs");
|
|
942
|
+
Object.keys(_opacity).forEach(function (key) {
|
|
943
|
+
if (key === "default" || key === "__esModule") return;
|
|
944
|
+
if (key in exports && exports[key] === _opacity[key]) return;
|
|
945
|
+
Object.defineProperty(exports, key, {
|
|
946
|
+
enumerable: true,
|
|
947
|
+
get: function () {
|
|
948
|
+
return _opacity[key];
|
|
949
|
+
}
|
|
950
|
+
});
|
|
951
|
+
});
|
|
930
952
|
var _padding = require("./Commons/padding.interface.cjs");
|
|
931
953
|
Object.keys(_padding).forEach(function (key) {
|
|
932
954
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -47,6 +47,7 @@ export * from './Commons/adjacent.interface';
|
|
|
47
47
|
export * from './Commons/align.interface';
|
|
48
48
|
export * from './Commons/audio.interface';
|
|
49
49
|
export * from './Commons/autocomplete.interface';
|
|
50
|
+
export * from './Commons/backdrop.interface';
|
|
50
51
|
export * from './Commons/border.interface';
|
|
51
52
|
export * from './Commons/box.interface';
|
|
52
53
|
export * from './Commons/clickOutside.interface';
|
|
@@ -82,6 +83,7 @@ export * from './Commons/locale.interface';
|
|
|
82
83
|
export * from './Commons/margin.interface';
|
|
83
84
|
export * from './Commons/message.interface';
|
|
84
85
|
export * from './Commons/nested.interface';
|
|
86
|
+
export * from './Commons/opacity.interface';
|
|
85
87
|
export * from './Commons/padding.interface';
|
|
86
88
|
export * from './Commons/position.interface';
|
|
87
89
|
export * from './Commons/resizeObserver.interface';
|
|
@@ -47,6 +47,7 @@ export * from "./Commons/adjacent.interface.js";
|
|
|
47
47
|
export * from "./Commons/align.interface.js";
|
|
48
48
|
export * from "./Commons/audio.interface.js";
|
|
49
49
|
export * from "./Commons/autocomplete.interface.js";
|
|
50
|
+
export * from "./Commons/backdrop.interface.js";
|
|
50
51
|
export * from "./Commons/border.interface.js";
|
|
51
52
|
export * from "./Commons/box.interface.js";
|
|
52
53
|
export * from "./Commons/clickOutside.interface.js";
|
|
@@ -82,6 +83,7 @@ export * from "./Commons/locale.interface.js";
|
|
|
82
83
|
export * from "./Commons/margin.interface.js";
|
|
83
84
|
export * from "./Commons/message.interface.js";
|
|
84
85
|
export * from "./Commons/nested.interface.js";
|
|
86
|
+
export * from "./Commons/opacity.interface.js";
|
|
85
87
|
export * from "./Commons/padding.interface.js";
|
|
86
88
|
export * from "./Commons/position.interface.js";
|
|
87
89
|
export * from "./Commons/resizeObserver.interface.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*********************************************************
|
|
2
|
+
* TBackdropBlur
|
|
3
|
+
*
|
|
4
|
+
* @description
|
|
5
|
+
* `backdropBlur` prop accepted by every component that consumes
|
|
6
|
+
* `useBackdrop` (`src/composables/Commons/backdrop.composable.ts`).
|
|
7
|
+
*
|
|
8
|
+
* @description
|
|
9
|
+
* Three shapes, disambiguated at runtime by `useBackdrop`:
|
|
10
|
+
* - a rung name (`'xs' | 'sm' | 'md' | 'lg' | 'xl'`) resolving to
|
|
11
|
+
* `blur(var(--origam-blur---{rung}))`;
|
|
12
|
+
* - `true`, meaning the default rung (`BACKDROP_BLUR_DEFAULT_RUNG`), so
|
|
13
|
+
* a consumer can write `backdrop-blur` with no value;
|
|
14
|
+
* - a number (read as `px`) or any CSS length string, emitted inside
|
|
15
|
+
* `blur(...)` verbatim.
|
|
16
|
+
*
|
|
17
|
+
* @description
|
|
18
|
+
* `false`, `null` and `undefined` all mean "no backdrop filter" and emit
|
|
19
|
+
* nothing at all — not `backdrop-filter: none`. Emitting `none` would win
|
|
20
|
+
* the cascade over a component's own rule and erase a blur the component
|
|
21
|
+
* painted for itself, the same defect #813 measured on `box-shadow`.
|
|
22
|
+
********************************************************/
|
|
23
|
+
export type TBackdropBlur = boolean | number | string;
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/*********************************************************
|
|
2
|
+
* TOpacity
|
|
3
|
+
*
|
|
4
|
+
* @description
|
|
5
|
+
* `opacity` prop accepted by every component that consumes `useOpacity`
|
|
6
|
+
* (`src/composables/Commons/opacity.composable.ts`).
|
|
7
|
+
*
|
|
8
|
+
* @description
|
|
9
|
+
* Two numeric readings share one type, disambiguated at runtime by the
|
|
10
|
+
* MAGNITUDE of the value — the same loose `number | string` union
|
|
11
|
+
* `TElevation` and `TRounded` use, for the same reason: the shapes are
|
|
12
|
+
* told apart by `useOpacity`, not by the type system.
|
|
13
|
+
*
|
|
14
|
+
* @description
|
|
15
|
+
* A number `<= 1` is read as a CSS fraction and emitted verbatim
|
|
16
|
+
* (`0.7` -> `opacity: 0.7`). A number `> 1` is read on the 0..100
|
|
17
|
+
* PERCENT scale that names the token rungs (`70` -> rung `70`), which is
|
|
18
|
+
* the vocabulary ADR-005's variant presets are written in
|
|
19
|
+
* (`plain: { opacity: 70, hover: { opacity: 100 } }`).
|
|
20
|
+
*
|
|
21
|
+
* @description
|
|
22
|
+
* ⛔ The split is at 1, not at 0, and that is deliberate. Reading every
|
|
23
|
+
* number on the percent scale would make `opacity={1}` mean 1 % — very
|
|
24
|
+
* nearly invisible — where every CSS author on earth means "opaque". The
|
|
25
|
+
* cost of the split is that 1 % cannot be written as a number; pass the
|
|
26
|
+
* string `'1%'` for it. That trade was chosen because `opacity={1}`
|
|
27
|
+
* meaning "opaque" is the single most likely thing a consumer types, and
|
|
28
|
+
* silently rendering it invisible is the worst available failure.
|
|
29
|
+
*
|
|
30
|
+
* @description
|
|
31
|
+
* A non-numeric string passes through verbatim, so `'50%'`,
|
|
32
|
+
* `'var(--origam-opacity---50)'` and `'calc(1 / 3)'` all reach the
|
|
33
|
+
* declaration untouched. Mirrors the custom-value escape hatch of
|
|
34
|
+
* `TRounded` / `TElevation`.
|
|
35
|
+
********************************************************/
|
|
36
|
+
export type TOpacity = number | string;
|
|
File without changes
|
|
@@ -2,6 +2,7 @@ import type { IBgColorProps, IColorProps } from '../../interfaces/Commons/color.
|
|
|
2
2
|
import type { IBorderProps } from '../../interfaces/Commons/border.interface';
|
|
3
3
|
import type { IElevationProps } from '../../interfaces/Commons/elevation.interface';
|
|
4
4
|
import type { IMarginProps } from '../../interfaces/Commons/margin.interface';
|
|
5
|
+
import type { IOpacityProps } from '../../interfaces/Commons/opacity.interface';
|
|
5
6
|
import type { IPaddingProps } from '../../interfaces/Commons/padding.interface';
|
|
6
7
|
import type { IRoundedProps } from '../../interfaces/Commons/rounded.interface';
|
|
7
8
|
/**
|
|
@@ -25,6 +26,6 @@ import type { IRoundedProps } from '../../interfaces/Commons/rounded.interface';
|
|
|
25
26
|
* OVERRIDE object a consumer passes to `hover` / `active`. This type
|
|
26
27
|
* describes the RESTING props those overrides are layered on top of.
|
|
27
28
|
*/
|
|
28
|
-
export type TStateEffectProps = IColorProps & IBgColorProps & IBorderProps & IRoundedProps & IElevationProps & IPaddingProps & IMarginProps & {
|
|
29
|
+
export type TStateEffectProps = IColorProps & IBgColorProps & IBorderProps & IRoundedProps & IElevationProps & IPaddingProps & IMarginProps & IOpacityProps & {
|
|
29
30
|
gap?: boolean | number | string;
|
|
30
31
|
};
|
package/dist/src/types/index.cjs
CHANGED
|
@@ -597,6 +597,17 @@ Object.keys(_dimension).forEach(function (key) {
|
|
|
597
597
|
}
|
|
598
598
|
});
|
|
599
599
|
});
|
|
600
|
+
var _backdrop = require("./Commons/backdrop.type.cjs");
|
|
601
|
+
Object.keys(_backdrop).forEach(function (key) {
|
|
602
|
+
if (key === "default" || key === "__esModule") return;
|
|
603
|
+
if (key in exports && exports[key] === _backdrop[key]) return;
|
|
604
|
+
Object.defineProperty(exports, key, {
|
|
605
|
+
enumerable: true,
|
|
606
|
+
get: function () {
|
|
607
|
+
return _backdrop[key];
|
|
608
|
+
}
|
|
609
|
+
});
|
|
610
|
+
});
|
|
600
611
|
var _elevation = require("./Commons/elevation.type.cjs");
|
|
601
612
|
Object.keys(_elevation).forEach(function (key) {
|
|
602
613
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -608,6 +619,17 @@ Object.keys(_elevation).forEach(function (key) {
|
|
|
608
619
|
}
|
|
609
620
|
});
|
|
610
621
|
});
|
|
622
|
+
var _opacity = require("./Commons/opacity.type.cjs");
|
|
623
|
+
Object.keys(_opacity).forEach(function (key) {
|
|
624
|
+
if (key === "default" || key === "__esModule") return;
|
|
625
|
+
if (key in exports && exports[key] === _opacity[key]) return;
|
|
626
|
+
Object.defineProperty(exports, key, {
|
|
627
|
+
enumerable: true,
|
|
628
|
+
get: function () {
|
|
629
|
+
return _opacity[key];
|
|
630
|
+
}
|
|
631
|
+
});
|
|
632
|
+
});
|
|
611
633
|
var _variant = require("./Commons/variant.type.cjs");
|
|
612
634
|
Object.keys(_variant).forEach(function (key) {
|
|
613
635
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -52,7 +52,9 @@ export * from './Commons/letter-spacing.type';
|
|
|
52
52
|
export * from './Commons/line-height.type';
|
|
53
53
|
export * from './Commons/rounded.type';
|
|
54
54
|
export * from './Commons/dimension.type';
|
|
55
|
+
export * from './Commons/backdrop.type';
|
|
55
56
|
export * from './Commons/elevation.type';
|
|
57
|
+
export * from './Commons/opacity.type';
|
|
56
58
|
export * from './Commons/variant.type';
|
|
57
59
|
export * from './Commons/variant-preset.type';
|
|
58
60
|
export * from './Commons/direction.type';
|
package/dist/src/types/index.js
CHANGED
|
@@ -52,7 +52,9 @@ export * from "./Commons/letter-spacing.type.js";
|
|
|
52
52
|
export * from "./Commons/line-height.type.js";
|
|
53
53
|
export * from "./Commons/rounded.type.js";
|
|
54
54
|
export * from "./Commons/dimension.type.js";
|
|
55
|
+
export * from "./Commons/backdrop.type.js";
|
|
55
56
|
export * from "./Commons/elevation.type.js";
|
|
57
|
+
export * from "./Commons/opacity.type.js";
|
|
56
58
|
export * from "./Commons/variant.type.js";
|
|
57
59
|
export * from "./Commons/variant-preset.type.js";
|
|
58
60
|
export * from "./Commons/direction.type.js";
|