origam 2.8.1 → 2.9.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.
- package/dist/src/assets/css/main.css +1 -1
- package/dist/src/assets/css/tokens/dark.css +32 -0
- package/dist/src/assets/css/tokens/light.css +16 -0
- package/dist/src/assets/scss/tokens/_dark.scss +16 -0
- package/dist/src/assets/scss/tokens/_light.scss +16 -0
- package/dist/src/components/Alert/OrigamAlert.vue +4 -2
- package/dist/src/components/Avatar/OrigamAvatarGroup.vue +31 -12
- package/dist/src/components/Btn/OrigamBtn.vue +11 -2
- package/dist/src/components/Btn/OrigamBtnGroup.vue +204 -22
- package/dist/src/components/Btn/OrigamBtnToggle.vue +5 -1
- package/dist/src/components/Card/OrigamCard.vue +5 -2
- package/dist/src/components/Checkbox/OrigamCheckbox.vue +3 -1
- package/dist/src/components/Chip/OrigamChip.vue +2 -0
- package/dist/src/components/Code/OrigamCode.vue +4 -2
- package/dist/src/components/ColorPickerField/OrigamColorPickerField.vue +19 -2
- package/dist/src/components/DatePickerField/OrigamDatePickerField.vue +3 -2
- package/dist/src/components/Dialog/OrigamDialog.vue +1 -1
- package/dist/src/components/Field/OrigamField.vue +7 -0
- package/dist/src/components/Layout/OrigamLayout.vue +10 -1
- package/dist/src/components/Menu/OrigamMenu.vue +3 -1
- package/dist/src/components/NumberField/OrigamNumberField.vue +3 -2
- package/dist/src/components/Overlay/OrigamOverlayScrim.vue +2 -0
- package/dist/src/components/Radio/OrigamRadio.vue +3 -1
- package/dist/src/components/Select/OrigamSelect.vue +3 -1
- package/dist/src/components/SelectionControl/OrigamSelectionControl.vue +2 -0
- package/dist/src/components/SliderField/OrigamSliderField.vue +3 -1
- package/dist/src/components/Snackbar/OrigamSnackbar.vue +3 -1
- package/dist/src/components/Snackbar/OrigamSnackbarItem.vue +2 -0
- package/dist/src/components/Switch/OrigamSwitch.vue +42 -1
- package/dist/src/components/Switch/OrigamSwitchTrack.vue +35 -2
- package/dist/src/components/Table/OrigamTable.vue +4 -2
- package/dist/src/components/Tabs/OrigamTabs.vue +3 -1
- package/dist/src/components/Tooltip/OrigamTooltip.vue +2 -0
- package/dist/src/composables/Commons/defaults.composable.cjs +10 -6
- package/dist/src/composables/Commons/defaults.composable.d.ts +30 -0
- package/dist/src/composables/Commons/defaults.composable.js +9 -6
- package/dist/src/composables/Theme/theme.composable.cjs +49 -30
- package/dist/src/composables/Theme/theme.composable.js +41 -22
- package/dist/src/interfaces/App/app.interface.d.ts +1 -1
- package/dist/src/interfaces/Btn/btn-group.interface.d.ts +2 -2
- package/dist/src/interfaces/Switch/switch-track.interface.d.ts +23 -6
- package/dist/src/themes/origam.theme.cjs +2 -4
- package/dist/src/themes/origam.theme.js +2 -2
- package/dist/src/types/tokens.type.d.ts +1 -1
- package/dist/src/utils/Commons/commons.util.cjs +10 -0
- package/dist/src/utils/Commons/commons.util.d.ts +18 -0
- package/dist/src/utils/Commons/commons.util.js +9 -0
- package/package.json +1 -1
|
@@ -28,14 +28,17 @@
|
|
|
28
28
|
<script lang="ts" setup>
|
|
29
29
|
import { OrigamBtn, OrigamDefaultsProvider } from "../../components";
|
|
30
30
|
import {
|
|
31
|
+
useDefaults,
|
|
31
32
|
useDensity,
|
|
32
33
|
useProps,
|
|
34
|
+
useSize,
|
|
33
35
|
useStateEffect,
|
|
34
|
-
useStyle
|
|
36
|
+
useStyle,
|
|
37
|
+
useVariant
|
|
35
38
|
} from "../../composables";
|
|
36
39
|
import { DENSITY } from "../../enums";
|
|
37
40
|
import { computed, StyleValue, useSlots } from "vue";
|
|
38
|
-
const
|
|
41
|
+
const _props = defineProps({
|
|
39
42
|
divided: { type: Boolean, required: false },
|
|
40
43
|
items: { type: Array, required: false, default: () => [] },
|
|
41
44
|
tag: { type: String, required: false, default: "div" },
|
|
@@ -80,14 +83,19 @@ const props = defineProps({
|
|
|
80
83
|
paddingInline: { type: [Boolean, Number, String], required: false },
|
|
81
84
|
hover: { type: [Boolean, Object], required: false },
|
|
82
85
|
active: { type: [Boolean, Object], required: false },
|
|
83
|
-
activeClass: { type: String, required: false }
|
|
86
|
+
activeClass: { type: String, required: false },
|
|
87
|
+
variant: { type: null, required: false },
|
|
88
|
+
size: { type: null, required: false }
|
|
84
89
|
});
|
|
90
|
+
const props = useDefaults(_props);
|
|
85
91
|
const { filterProps } = useProps(props);
|
|
86
92
|
const slotDefaults = computed(() => ({
|
|
87
93
|
"origam-btn": {
|
|
94
|
+
variant: props.variant,
|
|
88
95
|
density: props.density,
|
|
89
96
|
color: props.color,
|
|
90
97
|
bgColor: props.bgColor,
|
|
98
|
+
size: props.size,
|
|
91
99
|
// New API: `hover` / `active` accept boolean | IHoverState |
|
|
92
100
|
// IActiveState; pass-through propagates the parent's intent
|
|
93
101
|
// override to each child OrigamBtn.
|
|
@@ -101,6 +109,8 @@ const hasItems = computed(() => {
|
|
|
101
109
|
return slots.default || !!items.value;
|
|
102
110
|
});
|
|
103
111
|
const { densityClasses } = useDensity(props);
|
|
112
|
+
const { sizeClasses } = useSize(props);
|
|
113
|
+
const { variantClasses } = useVariant(props);
|
|
104
114
|
const {
|
|
105
115
|
colorStyles,
|
|
106
116
|
borderClasses,
|
|
@@ -137,6 +147,8 @@ const btnGroupClasses = computed(() => {
|
|
|
137
147
|
roundedClasses.value,
|
|
138
148
|
marginClasses.value,
|
|
139
149
|
paddingClasses.value,
|
|
150
|
+
variantClasses.value,
|
|
151
|
+
sizeClasses.value,
|
|
140
152
|
props.class
|
|
141
153
|
];
|
|
142
154
|
});
|
|
@@ -155,13 +167,31 @@ defineExpose({
|
|
|
155
167
|
.origam-btn-group {
|
|
156
168
|
display: inline-flex;
|
|
157
169
|
flex-wrap: nowrap;
|
|
158
|
-
align-items:
|
|
170
|
+
align-items: stretch;
|
|
171
|
+
// `overflow: hidden` does the whole job of shaping the children:
|
|
172
|
+
// per CSS, the clip follows the PADDING-BOX curvature — the outer
|
|
173
|
+
// radius minus the border width — so square-cornered children are
|
|
174
|
+
// clipped flush against the inside of the border ring, on any
|
|
175
|
+
// border thickness, with the browser computing the inner radius.
|
|
159
176
|
overflow: hidden;
|
|
160
177
|
vertical-align: middle;
|
|
161
178
|
|
|
162
179
|
max-width: 100%;
|
|
163
180
|
min-width: 0;
|
|
164
|
-
|
|
181
|
+
// `--origam-btn-group---height` (own custom property, set by the
|
|
182
|
+
// `&--size-*` rules below) — NOT `--origam-btn---height` directly:
|
|
183
|
+
// that token is scoped LOCALLY to each Btn instance by its own
|
|
184
|
+
// size modifier class, it does not cascade from a sibling Split
|
|
185
|
+
// button down to the group. `box-sizing: border-box` makes this a
|
|
186
|
+
// TOTAL height (border included) — matching how Btn's own `height`
|
|
187
|
+
// already works — so the group's border-box height equals a themed
|
|
188
|
+
// btn's border-box height by construction, never taller by the
|
|
189
|
+
// border's own width. Children are `height: auto` + `align-items:
|
|
190
|
+
// stretch` (see :deep below): they fill the content box inside the
|
|
191
|
+
// border, exactly like a btn's own content sits inside its own
|
|
192
|
+
// border.
|
|
193
|
+
box-sizing: border-box;
|
|
194
|
+
height: calc(var(--origam-btn-group---height, 36px) + var(--origam-btn-group---density, 0px));
|
|
165
195
|
|
|
166
196
|
border-width: var(--origam-btn-group---border-width);
|
|
167
197
|
border-style: var(--origam-btn-group---border-style);
|
|
@@ -215,36 +245,177 @@ defineExpose({
|
|
|
215
245
|
--origam-btn-group---density: -8px;
|
|
216
246
|
}
|
|
217
247
|
|
|
218
|
-
|
|
219
|
-
|
|
248
|
+
// Same height values as `OrigamBtn`'s own `&--size-*` rules, one for
|
|
249
|
+
// one — a themed `<origam-btn-toggle size="small">` must resolve to
|
|
250
|
+
// the exact height a standalone `size="small"` Btn does.
|
|
251
|
+
&--size-x-small {
|
|
252
|
+
--origam-btn-group---height: 20px;
|
|
253
|
+
}
|
|
220
254
|
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
255
|
+
&--size-small {
|
|
256
|
+
--origam-btn-group---height: 28px;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
&--size-default {
|
|
260
|
+
--origam-btn-group---height: 36px;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
&--size-large {
|
|
264
|
+
--origam-btn-group---height: 44px;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
&--size-x-large {
|
|
268
|
+
--origam-btn-group---height: 52px;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
// Full parity with `OrigamBtn`'s own variant rules — same CSS
|
|
272
|
+
// custom properties, same literal values, one-for-one. A themed
|
|
273
|
+
// `origam-btn: { variant: 'outlined' }` (cartoon/geek/editorial)
|
|
274
|
+
// must produce the SAME border-width/border-color/background/
|
|
275
|
+
// box-shadow on the group as it does on a standalone Btn; the
|
|
276
|
+
// group is not allowed to fall back to a subset. Earlier passes
|
|
277
|
+
// only ported the `background-color` half of each rule (border/
|
|
278
|
+
// shadow were silently dropped), which is exactly what made the
|
|
279
|
+
// toggle read as "thin border, no shadow" next to a themed Btn's
|
|
280
|
+
// thick border + hard shadow under cartoon.
|
|
281
|
+
&--variant-flat {
|
|
282
|
+
box-shadow: none;
|
|
283
|
+
}
|
|
224
284
|
|
|
225
|
-
|
|
226
|
-
|
|
285
|
+
&--variant-text,
|
|
286
|
+
&--variant-plain {
|
|
287
|
+
background-color: transparent !important;
|
|
288
|
+
box-shadow: none;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
&--variant-elevated {
|
|
292
|
+
box-shadow: var(--origam-btn---box-shadow-elevated, var(--origam-shadow---md));
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
&--variant-tonal {
|
|
296
|
+
background-color: var(
|
|
297
|
+
--origam-btn---background-color-tonal,
|
|
298
|
+
var(--origam-color__surface---overlay)
|
|
299
|
+
) !important;
|
|
300
|
+
box-shadow: none;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
&--variant-outlined {
|
|
304
|
+
background-color: transparent !important;
|
|
305
|
+
// Mirror the literal border-width into the SAME custom property
|
|
306
|
+
// `--origam-btn-group---inner-border-radius` calc()s against
|
|
307
|
+
// (see the base rule above) — that calc reads the CUSTOM
|
|
308
|
+
// PROPERTY, which this rule would otherwise never touch (it
|
|
309
|
+
// only ever set the literal `border-width` property directly),
|
|
310
|
+
// leaving the calc's border-width input silently at its
|
|
311
|
+
// pre-variant fallback of 0 regardless of the REAL rendered
|
|
312
|
+
// border. `calc(20px - 0px)` still LOOKS plausible, so this
|
|
313
|
+
// class of bug doesn't throw or visibly break — it just quietly
|
|
314
|
+
// gives the child's fill the wrong inset curve.
|
|
315
|
+
--origam-btn-group---border-width: var(--origam-btn---border-width-outlined, var(--origam-border__width---thin));
|
|
316
|
+
border-width: var(--origam-btn-group---border-width);
|
|
317
|
+
border-style: solid;
|
|
318
|
+
border-color: var(--origam-btn---border-color, currentColor);
|
|
319
|
+
box-shadow: none;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
&--variant-ghost {
|
|
323
|
+
background-color: var(
|
|
324
|
+
--origam-btn---background-color-ghost,
|
|
325
|
+
color-mix(in srgb, currentColor 12%, transparent)
|
|
326
|
+
) !important;
|
|
327
|
+
// See the matching comment in `&--variant-outlined` above.
|
|
328
|
+
--origam-btn-group---border-width: var(--origam-btn---border-width-ghost, var(--origam-border__width---thin));
|
|
329
|
+
border-width: var(--origam-btn-group---border-width);
|
|
330
|
+
border-style: solid;
|
|
331
|
+
border-color: var(
|
|
332
|
+
--origam-btn---border-color-ghost,
|
|
333
|
+
color-mix(in srgb, currentColor 24%, transparent)
|
|
334
|
+
);
|
|
335
|
+
box-shadow: var(
|
|
336
|
+
--origam-btn---box-shadow-ghost,
|
|
337
|
+
0 0 0 1px color-mix(in srgb, currentColor 18%, transparent),
|
|
338
|
+
0 4px 18px 0 color-mix(in srgb, currentColor 28%, transparent),
|
|
339
|
+
0 1px 0 0 color-mix(in srgb, white 35%, transparent) inset
|
|
340
|
+
);
|
|
341
|
+
|
|
342
|
+
@supports (backdrop-filter: blur(8px)) or (-webkit-backdrop-filter: blur(8px)) {
|
|
343
|
+
backdrop-filter: var(--origam-btn---backdrop-filter-ghost, blur(8px));
|
|
344
|
+
-webkit-backdrop-filter: var(--origam-btn---backdrop-filter-ghost, blur(8px));
|
|
227
345
|
}
|
|
228
346
|
}
|
|
229
347
|
|
|
230
|
-
//
|
|
231
|
-
//
|
|
232
|
-
//
|
|
233
|
-
//
|
|
234
|
-
//
|
|
235
|
-
//
|
|
236
|
-
//
|
|
348
|
+
// A btnGroup/btnToggle reads as ONE button with internal
|
|
349
|
+
// separators — not N bordered buttons glued together. The GROUP
|
|
350
|
+
// owns the ONE visible border, the ONE outer radius and the ONE
|
|
351
|
+
// elevation; every child button is rendered "naked" (zero border
|
|
352
|
+
// of its own, zero radius, zero shadow) regardless of what the
|
|
353
|
+
// theme's OWN `origam-btn` config would normally paint on a
|
|
354
|
+
// standalone button — a themed `origam-btn: { border: true }`
|
|
355
|
+
// would otherwise stack a second border directly on top of the
|
|
356
|
+
// group's, reading as a visibly doubled/thicker line. `!important`
|
|
357
|
+
// is intentional: the group's design wins over the child's own
|
|
358
|
+
// resolved theme props.
|
|
359
|
+
//
|
|
360
|
+
// `overflow: hidden` alone clips the group to its own rounded
|
|
361
|
+
// shape but does NOT round the first/last child's own corners —
|
|
362
|
+
// a fully square button sitting inside a rounded clip leaves a
|
|
363
|
+
// visible gap at each of the 4 corners (the group's background
|
|
364
|
+
// showing through a "square peg in a round hole"). The first and
|
|
365
|
+
// last child must adopt the group's INNER radius — the outer
|
|
366
|
+
// radius minus the border's own width, i.e. the curve of the
|
|
367
|
+
// surface the border ring encloses, not the outer edge of the
|
|
368
|
+
// border itself. Using the outer radius here (as a previous pass
|
|
369
|
+
// did) is off by exactly `border-width`: on a thick border
|
|
370
|
+
// (cartoon's 3px) the active segment's fill corner curved too
|
|
371
|
+
// early, leaving a sliver of the group's own background visible
|
|
372
|
+
// between the fill and the inside of the border ring.
|
|
237
373
|
:deep(.origam-btn) {
|
|
374
|
+
border-width: 0 !important;
|
|
375
|
+
border-style: none !important;
|
|
238
376
|
border-radius: 0 !important;
|
|
239
377
|
box-shadow: none !important;
|
|
378
|
+
// `auto` releases the child's own explicit height so
|
|
379
|
+
// `align-items: stretch` fills the group's content box —
|
|
380
|
+
// the child occupies the inside of the border ring exactly
|
|
381
|
+
// like a standalone btn's content sits inside its own border.
|
|
382
|
+
height: auto !important;
|
|
383
|
+
min-height: 0 !important;
|
|
384
|
+
|
|
385
|
+
// Resting (non-selected) segments stay fully naked — no
|
|
386
|
+
// background of their own — so the group's ONE surface
|
|
387
|
+
// (painted above via `variantClasses`) shows through evenly
|
|
388
|
+
// across the whole strip instead of each child individually
|
|
389
|
+
// re-painting its own themed variant background (that
|
|
390
|
+
// per-child repaint, at varying opacity/tint per button, is
|
|
391
|
+
// what produced the inconsistent/blank-looking group surface
|
|
392
|
+
// bug). The SELECTED segment inside an `OrigamBtnToggle`
|
|
393
|
+
// keeps its own active-state background — that fill is the
|
|
394
|
+
// documented, intentional "reads as a real filled button"
|
|
395
|
+
// affordance for the current selection (see `OrigamBtn`'s
|
|
396
|
+
// `&--variant-outlined &--active` / `&--variant-tonal
|
|
397
|
+
// &--active` rules) and is NOT the bug being fixed here.
|
|
398
|
+
&:not(.origam-btn--active) {
|
|
399
|
+
background-color: transparent !important;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
// NO per-corner radius overrides: children stay square
|
|
403
|
+
// (`border-radius: 0` above) and the group's `overflow: hidden`
|
|
404
|
+
// clips them to its own inner curvature — the browser derives
|
|
405
|
+
// the inner radius (outer − border-width) natively.
|
|
240
406
|
}
|
|
241
407
|
|
|
408
|
+
// `divided` adds back a THIN, intentional separator between
|
|
409
|
+
// segments — NOT the child's own border reinstated (still zeroed
|
|
410
|
+
// on every other side by the block above). Colour matches the
|
|
411
|
+
// group's own resolved border color so it reads as part of the
|
|
412
|
+
// same single surface, not a second competing border.
|
|
242
413
|
&--divided {
|
|
243
414
|
:deep(.origam-btn) {
|
|
244
415
|
&:not(:last-child) {
|
|
245
|
-
border-inline-end-width: thin;
|
|
246
|
-
border-inline-end-style: solid;
|
|
247
|
-
border-inline-end-color:
|
|
416
|
+
border-inline-end-width: thin !important;
|
|
417
|
+
border-inline-end-style: solid !important;
|
|
418
|
+
border-inline-end-color: var(--origam-btn-group---border-color, currentColor) !important;
|
|
248
419
|
}
|
|
249
420
|
}
|
|
250
421
|
}
|
|
@@ -259,6 +430,17 @@ defineExpose({
|
|
|
259
430
|
--origam-btn-group---border-width: var(--origam-btn---border-width, 0);
|
|
260
431
|
--origam-btn-group---border-style: var(--origam-btn---border-style, solid);
|
|
261
432
|
--origam-btn-group---border-color: var(--origam-btn---border-color, currentColor);
|
|
433
|
+
/* Base surface fallback for the `flat`/`elevated`/unset variants
|
|
434
|
+
* (the ones that DON'T override background via their own
|
|
435
|
+
* `--variant-*` rule above) — mirrors `OrigamBtn`'s own base
|
|
436
|
+
* `background-color: var(--origam-btn---background-color, …)`
|
|
437
|
+
* rule so the group's resting surface always matches the
|
|
438
|
+
* theme's btn, never a hardcoded/transparent default. */
|
|
439
|
+
--origam-btn-group---background-color: var(--origam-btn---background-color, transparent);
|
|
440
|
+
/* Same fallback chain as background-color/border-* above — without
|
|
441
|
+
* it the group's text/currentColor (used by outlined/ghost border
|
|
442
|
+
* fallbacks) drifted from Btn's own default instead of matching. */
|
|
443
|
+
--origam-btn-group---color: var(--origam-btn---color, rgba(30, 30, 30, 0.87));
|
|
262
444
|
|
|
263
445
|
}
|
|
264
446
|
</style>
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
<script lang="ts" setup>
|
|
31
31
|
import { OrigamBtnGroup } from "../../components";
|
|
32
32
|
import {
|
|
33
|
+
useDefaults,
|
|
33
34
|
useGroup,
|
|
34
35
|
useProps,
|
|
35
36
|
useStyle
|
|
@@ -37,7 +38,7 @@ import {
|
|
|
37
38
|
import { ORIGAM_BTN_TOGGLE_KEY } from "../../consts";
|
|
38
39
|
import { DENSITY } from "../../enums";
|
|
39
40
|
import { computed, ref, StyleValue, useSlots } from "vue";
|
|
40
|
-
const
|
|
41
|
+
const _props = defineProps({
|
|
41
42
|
divided: { type: Boolean, required: false },
|
|
42
43
|
items: { type: Array, required: false, default: () => [] },
|
|
43
44
|
tag: { type: String, required: false, default: "div" },
|
|
@@ -83,6 +84,8 @@ const props = defineProps({
|
|
|
83
84
|
hover: { type: [Boolean, Object], required: false },
|
|
84
85
|
active: { type: [Boolean, Object], required: false },
|
|
85
86
|
activeClass: { type: String, required: false },
|
|
87
|
+
variant: { type: null, required: false },
|
|
88
|
+
size: { type: null, required: false },
|
|
86
89
|
disabled: { type: Boolean, required: false },
|
|
87
90
|
modelValue: { type: null, required: false },
|
|
88
91
|
multiple: { type: Boolean, required: false },
|
|
@@ -90,6 +93,7 @@ const props = defineProps({
|
|
|
90
93
|
max: { type: Number, required: false },
|
|
91
94
|
selectedClass: { type: String, required: false }
|
|
92
95
|
});
|
|
96
|
+
const props = useDefaults(_props);
|
|
93
97
|
defineEmits(["update:modelValue"]);
|
|
94
98
|
const { filterProps } = useProps(props);
|
|
95
99
|
const { isSelected, next, prev, select, selected } = useGroup(props, ORIGAM_BTN_TOGGLE_KEY);
|
|
@@ -146,6 +146,7 @@ import { OrigamCardHeader, OrigamCardText, OrigamImg, OrigamProgress, OrigamSkel
|
|
|
146
146
|
import {
|
|
147
147
|
useActive,
|
|
148
148
|
useAdjacent,
|
|
149
|
+
useDefaults,
|
|
149
150
|
useDensity,
|
|
150
151
|
useDimension,
|
|
151
152
|
useHover,
|
|
@@ -160,7 +161,7 @@ import {
|
|
|
160
161
|
import { vContrast, vRipple } from "../../directives";
|
|
161
162
|
import { DENSITY, PROGRESS_TYPE } from "../../enums";
|
|
162
163
|
import { computed, StyleValue, toRef, useAttrs, useSlots } from "vue";
|
|
163
|
-
const
|
|
164
|
+
const _props = defineProps({
|
|
164
165
|
disabled: { type: Boolean, required: false },
|
|
165
166
|
flat: { type: Boolean, required: false },
|
|
166
167
|
hover: { type: Boolean, required: false },
|
|
@@ -236,12 +237,14 @@ const props = defineProps({
|
|
|
236
237
|
active: { type: [Boolean, Object], required: false },
|
|
237
238
|
activeClass: { type: String, required: false }
|
|
238
239
|
});
|
|
240
|
+
const props = useDefaults(_props);
|
|
239
241
|
defineEmits(["click:append", "click:prepend", "update:active", "update:hover"]);
|
|
240
242
|
const { filterProps } = useProps(props);
|
|
241
243
|
const attrs = useAttrs();
|
|
242
244
|
const link = useLink(props, attrs);
|
|
243
245
|
const { isHover, hoverState, hoverClasses, onMouseenter, onMouseleave } = useHover(props);
|
|
244
246
|
const { isActive, activeState, activeClasses, onActive } = useActive(props);
|
|
247
|
+
const flatForElevation = computed(() => props.elevation != null ? false : props.flat);
|
|
245
248
|
const {
|
|
246
249
|
colorClasses,
|
|
247
250
|
colorStyles,
|
|
@@ -262,7 +265,7 @@ const {
|
|
|
262
265
|
hoverState,
|
|
263
266
|
activeState,
|
|
264
267
|
computed(() => !!props.disabled),
|
|
265
|
-
|
|
268
|
+
flatForElevation
|
|
266
269
|
);
|
|
267
270
|
const {
|
|
268
271
|
onClickPrepend: handleClickPrepend,
|
|
@@ -58,6 +58,7 @@
|
|
|
58
58
|
<script lang="ts" setup>
|
|
59
59
|
import { OrigamCheckboxBtn, OrigamInput } from "../../components";
|
|
60
60
|
import {
|
|
61
|
+
useDefaults,
|
|
61
62
|
useFocus,
|
|
62
63
|
useMargin,
|
|
63
64
|
usePadding,
|
|
@@ -68,7 +69,7 @@ import {
|
|
|
68
69
|
import { DENSITY } from "../../enums";
|
|
69
70
|
import { filterInputAttrs, getUid } from "../../utils";
|
|
70
71
|
import { computed, ref, StyleValue, useAttrs, useSlots } from "vue";
|
|
71
|
-
const
|
|
72
|
+
const _props = defineProps({
|
|
72
73
|
id: { type: String, required: false },
|
|
73
74
|
class: { type: [String, Array, Object], required: false },
|
|
74
75
|
style: { type: [String, Array, Object, Boolean, null], required: false, skipCheck: true },
|
|
@@ -162,6 +163,7 @@ const props = defineProps({
|
|
|
162
163
|
activeClass: { type: String, required: false },
|
|
163
164
|
hover: { type: [Boolean, Object], required: false }
|
|
164
165
|
});
|
|
166
|
+
const props = useDefaults(_props);
|
|
165
167
|
const emits = defineEmits(["update:modelValue", "update:focused", "click:label"]);
|
|
166
168
|
defineSlots();
|
|
167
169
|
const { filterProps } = useProps(props);
|
|
@@ -365,6 +365,8 @@ defineExpose({
|
|
|
365
365
|
|
|
366
366
|
background-color: var(--origam-chip---background-color);
|
|
367
367
|
color: var(--origam-chip---color);
|
|
368
|
+
backdrop-filter: var(--origam-chip---backdrop-filter, none);
|
|
369
|
+
-webkit-backdrop-filter: var(--origam-chip---backdrop-filter, none);
|
|
368
370
|
|
|
369
371
|
&__content {
|
|
370
372
|
align-items: center;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<component
|
|
3
|
-
:is="tag"
|
|
3
|
+
:is="props.tag"
|
|
4
4
|
v-contrast
|
|
5
5
|
:class="codeClasses"
|
|
6
6
|
:style="codeStyles"
|
|
@@ -82,6 +82,7 @@ import {
|
|
|
82
82
|
useDimension,
|
|
83
83
|
useElevation,
|
|
84
84
|
useLocale,
|
|
85
|
+
useDefaults,
|
|
85
86
|
useMargin,
|
|
86
87
|
usePadding,
|
|
87
88
|
useRounded,
|
|
@@ -91,7 +92,7 @@ import { vContrast } from "../../directives";
|
|
|
91
92
|
import { CODE_DEFAULTS } from "../../consts";
|
|
92
93
|
import { CODE_LANG } from "../../enums";
|
|
93
94
|
import { parseHighlightLines } from "../../utils";
|
|
94
|
-
const
|
|
95
|
+
const _props = defineProps({
|
|
95
96
|
code: { type: String, required: false, default: void 0 },
|
|
96
97
|
lang: { type: null, required: false, default: CODE_LANG.PLAINTEXT },
|
|
97
98
|
lineNumbers: { type: Boolean, required: false, default: false },
|
|
@@ -153,6 +154,7 @@ const props = defineProps({
|
|
|
153
154
|
lineHeight: { type: String, required: false },
|
|
154
155
|
letterSpacing: { type: String, required: false }
|
|
155
156
|
});
|
|
157
|
+
const props = useDefaults(_props);
|
|
156
158
|
const emit = defineEmits(["copy"]);
|
|
157
159
|
const slots = useSlots();
|
|
158
160
|
const { borderClasses, borderStyles } = useBorder(props);
|
|
@@ -128,12 +128,12 @@
|
|
|
128
128
|
|
|
129
129
|
<script lang="ts" setup>
|
|
130
130
|
import { OrigamColorPicker, OrigamMenu, OrigamSheet, OrigamTextField, OrigamTranslateScale } from "../../components";
|
|
131
|
-
import { useLocale, useProps, useVModel, useStyle } from "../../composables";
|
|
131
|
+
import { useDefaults, useLocale, useProps, useVModel, useStyle } from "../../composables";
|
|
132
132
|
import { COLOR_NULL, ORIGAM_FORM_KEY } from "../../consts";
|
|
133
133
|
import { BLOCK, DENSITY, DIRECTION, TEXT_FIELD_TYPE } from "../../enums";
|
|
134
134
|
import { forwardRefs, HSVtoCSS, matchesSelector } from "../../utils";
|
|
135
135
|
import { computed, inject, nextTick, ref, shallowRef, StyleValue, useSlots, watch } from "vue";
|
|
136
|
-
const
|
|
136
|
+
const _props = defineProps({
|
|
137
137
|
menu: { type: Boolean, required: false },
|
|
138
138
|
menuProps: { type: Object, required: false },
|
|
139
139
|
openOnClear: { type: Boolean, required: false },
|
|
@@ -251,6 +251,7 @@ const props = defineProps({
|
|
|
251
251
|
prependIcon: { type: null, required: false },
|
|
252
252
|
transition: { type: [Boolean, String, Object], required: false, default: () => ({ component: OrigamTranslateScale }) }
|
|
253
253
|
});
|
|
254
|
+
const props = useDefaults(_props);
|
|
254
255
|
const { filterProps } = useProps(props);
|
|
255
256
|
const { t } = useLocale();
|
|
256
257
|
const origamTextFieldRef = ref();
|
|
@@ -418,5 +419,21 @@ defineExpose(forwardRefs({
|
|
|
418
419
|
font-size: 0.875em;
|
|
419
420
|
letter-spacing: 0.03em;
|
|
420
421
|
}
|
|
422
|
+
|
|
423
|
+
// `.origam-field__input` is `display: flex; flex-wrap: wrap` by
|
|
424
|
+
// default (`OrigamField`'s base rule, meant for multi-chip inputs).
|
|
425
|
+
// This field renders BOTH the hex `colorSelection` span AND the
|
|
426
|
+
// underlying native `<input>` in that same row — in a narrow
|
|
427
|
+
// container (e.g. a dense side panel) the two don't fit on one
|
|
428
|
+
// line and wrap onto two, DOUBLING the field's height versus a
|
|
429
|
+
// plain text-field of the same density (confirmed: 55px vs 26px
|
|
430
|
+
// at compact density, identical width). The native input's own
|
|
431
|
+
// text is not meant to be visible here (the formatted
|
|
432
|
+
// `colorSelection` span is the real display value) — forcing
|
|
433
|
+
// `nowrap` lets the invisible native input shrink instead of
|
|
434
|
+
// pushing a wrap, with zero visual loss.
|
|
435
|
+
:deep(.origam-field__input) {
|
|
436
|
+
flex-wrap: nowrap;
|
|
437
|
+
}
|
|
421
438
|
}
|
|
422
439
|
</style>
|
|
@@ -180,12 +180,12 @@ import {
|
|
|
180
180
|
OrigamTextField,
|
|
181
181
|
OrigamTranslateScale
|
|
182
182
|
} from "../../components";
|
|
183
|
-
import { useDate, useLocale, useProps, useTextColor, useVModel, useStyle } from "../../composables";
|
|
183
|
+
import { useDate, useDefaults, useLocale, useProps, useTextColor, useVModel, useStyle } from "../../composables";
|
|
184
184
|
import { ORIGAM_FORM_KEY } from "../../consts";
|
|
185
185
|
import { BLOCK, DENSITY, DIRECTION, KEYBOARD_VALUES, MDI_ICONS, TEXT_FIELD_TYPE } from "../../enums";
|
|
186
186
|
import { forwardRefs, isEmpty, matchesSelector, wrapInArray } from "../../utils";
|
|
187
187
|
import { computed, inject, nextTick, ref, shallowRef, StyleValue, toRef, useSlots, watch } from "vue";
|
|
188
|
-
const
|
|
188
|
+
const _props = defineProps({
|
|
189
189
|
menu: { type: Boolean, required: false },
|
|
190
190
|
menuProps: { type: Object, required: false },
|
|
191
191
|
range: { type: Boolean, required: false, default: false },
|
|
@@ -307,6 +307,7 @@ const props = defineProps({
|
|
|
307
307
|
prependIcon: { type: null, required: false },
|
|
308
308
|
transition: { type: [Boolean, String, Object], required: false, default: () => ({ component: OrigamTranslateScale }) }
|
|
309
309
|
});
|
|
310
|
+
const props = useDefaults(_props);
|
|
310
311
|
const { filterProps } = useProps(props);
|
|
311
312
|
const { t } = useLocale();
|
|
312
313
|
const origamTextFieldRef = ref();
|
|
@@ -184,7 +184,7 @@ const props = defineProps({
|
|
|
184
184
|
contained: { type: Boolean, required: false },
|
|
185
185
|
eager: { type: Boolean, required: false },
|
|
186
186
|
transition: { type: [Boolean, String, Object], required: false, default: () => ({ component: OrigamTranslateScale }) },
|
|
187
|
-
scrim: { type: [Boolean, String], required: false },
|
|
187
|
+
scrim: { type: [Boolean, String], required: false, default: true },
|
|
188
188
|
flat: { type: Boolean, required: false },
|
|
189
189
|
hover: { type: Boolean, required: false },
|
|
190
190
|
image: { type: String, required: false },
|
|
@@ -520,6 +520,8 @@ defineExpose({
|
|
|
520
520
|
grid-area: control;
|
|
521
521
|
position: relative;
|
|
522
522
|
padding-inline: var(--origam-field---padding-start) var(--origam-field---padding-end);
|
|
523
|
+
backdrop-filter: var(--origam-field---backdrop-filter, none);
|
|
524
|
+
-webkit-backdrop-filter: var(--origam-field---backdrop-filter, none);
|
|
523
525
|
|
|
524
526
|
&__skeleton {
|
|
525
527
|
width: 100%;
|
|
@@ -788,6 +790,11 @@ defineExpose({
|
|
|
788
790
|
#{$this}__label {
|
|
789
791
|
opacity: 1;
|
|
790
792
|
}
|
|
793
|
+
|
|
794
|
+
&:not(#{$this}--disabled) {
|
|
795
|
+
outline: var(--origam-field---focus-ring-width, 0px) solid var(--origam-field---focus-ring-color, transparent);
|
|
796
|
+
outline-offset: var(--origam-field---focus-ring-offset, 0px);
|
|
797
|
+
}
|
|
791
798
|
}
|
|
792
799
|
|
|
793
800
|
&--disabled,
|
|
@@ -151,8 +151,17 @@ defineExpose({
|
|
|
151
151
|
}
|
|
152
152
|
|
|
153
153
|
&--full-height &__wrapper {
|
|
154
|
+
// `min-height` (not `height`) — full-height means "occupy AT
|
|
155
|
+
// LEAST the viewport", not "clip to exactly the viewport".
|
|
156
|
+
// A fixed `height: 100vh` kept the wrapper's own box capped
|
|
157
|
+
// at one screen even when its content (app-bar + main slot)
|
|
158
|
+
// grows taller — the overflow still rendered (no
|
|
159
|
+
// `overflow: hidden` here) but the wrapper's box, and
|
|
160
|
+
// anything painting a background on an ancestor sized off
|
|
161
|
+
// it, never grew to match, leaving a visible gap below the
|
|
162
|
+
// first viewport on any page taller than one screen.
|
|
154
163
|
width: 100vw;
|
|
155
|
-
height: 100vh;
|
|
164
|
+
min-height: 100vh;
|
|
156
165
|
}
|
|
157
166
|
}
|
|
158
167
|
</style>
|
|
@@ -81,6 +81,7 @@ import {
|
|
|
81
81
|
} from "../../components";
|
|
82
82
|
import {
|
|
83
83
|
useBothColor,
|
|
84
|
+
useDefaults,
|
|
84
85
|
useProps,
|
|
85
86
|
useScopeId,
|
|
86
87
|
useStateEffect,
|
|
@@ -90,7 +91,7 @@ import {
|
|
|
90
91
|
import { ORIGAM_MENU_KEY } from "../../consts";
|
|
91
92
|
import { INLINE, KEYBOARD_VALUES, LOCATION_STRATEGIES, MDI_ICONS, SCROLL_STRATEGIES } from "../../enums";
|
|
92
93
|
import { focusableChildren, focusChild, forwardRefs, getNextElement, getUid } from "../../utils";
|
|
93
|
-
const
|
|
94
|
+
const _props = defineProps({
|
|
94
95
|
id: { type: String, required: false },
|
|
95
96
|
absolute: { type: Boolean, required: false },
|
|
96
97
|
attach: { type: [Boolean, String], required: false, skipCheck: true },
|
|
@@ -208,6 +209,7 @@ const props = defineProps({
|
|
|
208
209
|
lineHeight: { type: String, required: false },
|
|
209
210
|
letterSpacing: { type: String, required: false }
|
|
210
211
|
});
|
|
212
|
+
const props = useDefaults(_props);
|
|
211
213
|
defineEmits(["contextmenu", "update:modelValue"]);
|
|
212
214
|
const { filterProps } = useProps(props);
|
|
213
215
|
const { colorClasses, colorStyles } = useBothColor(toRef(props, "bgColor"), toRef(props, "color"));
|
|
@@ -269,10 +269,10 @@
|
|
|
269
269
|
<script lang="ts" setup>
|
|
270
270
|
import { computed, nextTick, onMounted, ref, shallowRef, StyleValue, useSlots, watch } from "vue";
|
|
271
271
|
import { OrigamBtn, OrigamDivider, OrigamInput, OrigamTextField } from "../../components";
|
|
272
|
-
import { useAdjacentInner, useFocus, useHold, useProps, useVModel, useStyle } from "../../composables";
|
|
272
|
+
import { useAdjacentInner, useDefaults, useFocus, useHold, useProps, useVModel, useStyle } from "../../composables";
|
|
273
273
|
import { DIRECTION, MDI_ICONS, TEXT_FIELD_TYPE } from "../../enums";
|
|
274
274
|
import { clamp, forwardRefs } from "../../utils";
|
|
275
|
-
const
|
|
275
|
+
const _props = defineProps({
|
|
276
276
|
autofocus: { type: Boolean, required: false },
|
|
277
277
|
placeholder: { type: String, required: false },
|
|
278
278
|
persistentPlaceholder: { type: Boolean, required: false },
|
|
@@ -391,6 +391,7 @@ const props = defineProps({
|
|
|
391
391
|
prependAvatar: { type: String, required: false },
|
|
392
392
|
prependIcon: { type: null, required: false }
|
|
393
393
|
});
|
|
394
|
+
const props = useDefaults(_props);
|
|
394
395
|
const emits = defineEmits(["click:control", "mousedown:control", "click:clear", "increment", "decrement", "update:focused", "update:modelValue", "click:appendInner", "click:prependInner", "update:active", "click:append", "click:prepend"]);
|
|
395
396
|
defineSlots();
|
|
396
397
|
const { filterProps } = useProps(props);
|
|
@@ -72,6 +72,8 @@ defineExpose({
|
|
|
72
72
|
<style lang="scss" scoped>
|
|
73
73
|
.origam-scrim {
|
|
74
74
|
background-color: var(--origam-overlay-scrim---background-color, var(--origam-color__overlay---scrim)); // TODO: rename to color.overlay.backdrop once #arbitration2 resolved
|
|
75
|
+
backdrop-filter: var(--origam-overlay-scrim---backdrop-filter, none);
|
|
76
|
+
-webkit-backdrop-filter: var(--origam-overlay-scrim---backdrop-filter, none);
|
|
75
77
|
pointer-events: var(--origam-overlay-scrim---pointer-events, auto);
|
|
76
78
|
border-radius: inherit;
|
|
77
79
|
inset: 0;
|
|
@@ -103,6 +103,7 @@
|
|
|
103
103
|
import { computed, ref, StyleValue, useAttrs, useSlots } from "vue";
|
|
104
104
|
import { OrigamInput, OrigamRadioBtn } from "../../components";
|
|
105
105
|
import {
|
|
106
|
+
useDefaults,
|
|
106
107
|
useFocus,
|
|
107
108
|
useHover,
|
|
108
109
|
useMargin,
|
|
@@ -114,7 +115,7 @@ import {
|
|
|
114
115
|
} from "../../composables";
|
|
115
116
|
import { DENSITY } from "../../enums";
|
|
116
117
|
import { filterInputAttrs, getUid } from "../../utils";
|
|
117
|
-
const
|
|
118
|
+
const _props = defineProps({
|
|
118
119
|
id: { type: String, required: false },
|
|
119
120
|
class: { type: [String, Array, Object], required: false },
|
|
120
121
|
style: { type: [String, Array, Object, Boolean, null], required: false, skipCheck: true },
|
|
@@ -206,6 +207,7 @@ const props = defineProps({
|
|
|
206
207
|
activeClass: { type: String, required: false },
|
|
207
208
|
hover: { type: [Boolean, Object], required: false }
|
|
208
209
|
});
|
|
210
|
+
const props = useDefaults(_props);
|
|
209
211
|
const emits = defineEmits(["update:modelValue", "update:focused", "click:label"]);
|
|
210
212
|
const { isHover, hoverState } = useHover(props);
|
|
211
213
|
useStateEffect(props, isHover, void 0, hoverState, void 0);
|