orio-ui 1.28.0 โ 1.28.1
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/README.md +1 -1
- package/dist/agents/ROUTING.md +1 -1
- package/dist/module.json +1 -1
- package/dist/runtime/components/Button.USAGE.md +5 -0
- package/dist/runtime/components/Button.d.vue.ts +1 -0
- package/dist/runtime/components/Button.vue +5 -1
- package/dist/runtime/components/Button.vue.d.ts +1 -0
- package/dist/runtime/components/ControlElement.d.vue.ts +1 -1
- package/dist/runtime/components/ControlElement.vue.d.ts +1 -1
- package/dist/runtime/components/NumberInput/Horizontal.vue +5 -0
- package/dist/runtime/components/NumberInput/Vertical.vue +9 -1
- package/dist/runtime/composables/useControlSize.USAGE.md +2 -2
- package/dist/runtime/composables/useControlSize.js +12 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -23,7 +23,7 @@ orio-ui's shipped, version-pinned agent docs. Details in
|
|
|
23
23
|
๐ **Auto-imported** - Works seamlessly with Nuxt's auto-import system
|
|
24
24
|
๐ฆ **Tree-shakeable** - Only bundle what you use
|
|
25
25
|
๐ฏ **TypeScript** - Fully typed for great developer experience
|
|
26
|
-
๐งช **Tested** -
|
|
26
|
+
๐งช **Tested** - 37 test suites for reliability
|
|
27
27
|
๐ฑ **Responsive** - Mobile-first design approach
|
|
28
28
|
โฟ **Accessible** - ARIA-compliant components
|
|
29
29
|
๐ **i18n** - Built-in vue-i18n support with English defaults
|
package/dist/agents/ROUTING.md
CHANGED
|
@@ -116,7 +116,7 @@ installed version.
|
|
|
116
116
|
|
|
117
117
|
### Composables
|
|
118
118
|
- `useApi` โ thin typed wrapper around ofetch's `$fetch` for GET/POST/PUT/DELETE/PATCH requests.
|
|
119
|
-
- `useControlSize` โ provide/inject `ControlSize` (sm/md/lg/xl) and read a CSS-var token bag for the active size. **Read USAGE.md first.**
|
|
119
|
+
- `useControlSize` โ provide/inject `ControlSize` (xs/sm/md/lg/xl) and read a CSS-var token bag for the active size. **Read USAGE.md first.**
|
|
120
120
|
- `useDecimalFormatter` โ parse numeric strings (US or EU separator) and format via Intl.NumberFormat with locale defaults. **Read USAGE.md first.**
|
|
121
121
|
- `useFilter` โ named filter group with v-bind bags, $-helpers, $active chips, $clearAll, optional URL sync via lazy import. **Read USAGE.md first.**
|
|
122
122
|
- `useFuzzySearch` โ typed Fuse.js wrapper that returns a computed list of matched items (strings or objects).
|
package/dist/module.json
CHANGED
|
@@ -27,6 +27,9 @@ often used standalone.
|
|
|
27
27
|
- **Icon-only mode is auto-detected.** When an icon is present and the
|
|
28
28
|
default slot is empty, `.icon-only` is applied โ `aspect-ratio: 1`,
|
|
29
29
|
`line-height: 0`. No need to pass a prop.
|
|
30
|
+
- **`pill` prop**: `false` by default. When `true`, swaps the button's
|
|
31
|
+
`border-radius` to `var(--border-radius-pill)` (fully rounded),
|
|
32
|
+
overriding the size-driven `--control-radius`. No effect when omitted.
|
|
30
33
|
- **`disabled` blocks `click` and `mousedown` emits.** `mouseup` and
|
|
31
34
|
`mouseleave` always fire (so press-and-hold callers can release
|
|
32
35
|
state).
|
|
@@ -67,6 +70,8 @@ often used standalone.
|
|
|
67
70
|
</orio-button>
|
|
68
71
|
|
|
69
72
|
<orio-button variant="subdued" icon="close" aria-label="Close" />
|
|
73
|
+
|
|
74
|
+
<orio-button pill icon="plus" aria-label="Add" />
|
|
70
75
|
</template>
|
|
71
76
|
```
|
|
72
77
|
|
|
@@ -4,6 +4,7 @@ const props = defineProps({
|
|
|
4
4
|
variant: { type: String, required: false, default: "primary" },
|
|
5
5
|
icon: { type: String, required: false },
|
|
6
6
|
loading: { type: Boolean, required: false },
|
|
7
|
+
pill: { type: Boolean, required: false },
|
|
7
8
|
appearance: { type: String, required: false },
|
|
8
9
|
error: { type: [String, null], required: false },
|
|
9
10
|
group: { type: Boolean, required: false },
|
|
@@ -47,7 +48,7 @@ function onMouseleave(event) {
|
|
|
47
48
|
<orio-control-element v-slot="{ control }" v-bind="props">
|
|
48
49
|
<button
|
|
49
50
|
v-bind="{ ...$attrs, ...control }"
|
|
50
|
-
:class="[variant, 'gradient-hover', { 'icon-only': isIconOnly }]"
|
|
51
|
+
:class="[variant, 'gradient-hover', { 'icon-only': isIconOnly, pill }]"
|
|
51
52
|
@click="click"
|
|
52
53
|
@mousedown="onMousedown"
|
|
53
54
|
@mouseup="onMouseup"
|
|
@@ -85,6 +86,9 @@ button.icon-only {
|
|
|
85
86
|
line-height: 0;
|
|
86
87
|
aspect-ratio: 1;
|
|
87
88
|
}
|
|
89
|
+
button.pill {
|
|
90
|
+
border-radius: var(--border-radius-pill);
|
|
91
|
+
}
|
|
88
92
|
button:disabled, button:disabled:hover {
|
|
89
93
|
background-color: var(--color-accent-soft-base);
|
|
90
94
|
color: var(--color-muted);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type ControlLayout = "vertical" | "horizontal";
|
|
2
|
-
export type ControlSize = "sm" | "md" | "lg" | "xl";
|
|
2
|
+
export type ControlSize = "xs" | "sm" | "md" | "lg" | "xl";
|
|
3
3
|
/**
|
|
4
4
|
* A11y + form attrs that flow from the caller through ControlElement to the
|
|
5
5
|
* actual interactive element via the `control` slot prop. Never rendered on
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type ControlLayout = "vertical" | "horizontal";
|
|
2
|
-
export type ControlSize = "sm" | "md" | "lg" | "xl";
|
|
2
|
+
export type ControlSize = "xs" | "sm" | "md" | "lg" | "xl";
|
|
3
3
|
/**
|
|
4
4
|
* A11y + form attrs that flow from the caller through ControlElement to the
|
|
5
5
|
* actual interactive element via the `control` slot prop. Never rendered on
|
|
@@ -31,6 +31,7 @@ const { pressAndHold, stop } = usePressAndHold();
|
|
|
31
31
|
appearance="minimal"
|
|
32
32
|
icon="minus"
|
|
33
33
|
variant="subdued"
|
|
34
|
+
size="sm"
|
|
34
35
|
:disabled="isAtMin || disabled"
|
|
35
36
|
@mousedown="pressAndHold(decrease)"
|
|
36
37
|
@mouseup="stop"
|
|
@@ -40,6 +41,7 @@ const { pressAndHold, stop } = usePressAndHold();
|
|
|
40
41
|
appearance="minimal"
|
|
41
42
|
icon="plus"
|
|
42
43
|
variant="subdued"
|
|
44
|
+
size="sm"
|
|
43
45
|
:disabled="isAtMax || disabled"
|
|
44
46
|
@mousedown="pressAndHold(increase)"
|
|
45
47
|
@mouseup="stop"
|
|
@@ -65,4 +67,7 @@ const { pressAndHold, stop } = usePressAndHold();
|
|
|
65
67
|
right: 0;
|
|
66
68
|
text-align: center;
|
|
67
69
|
}
|
|
70
|
+
.horizontal :deep(.control-group) {
|
|
71
|
+
z-index: 2;
|
|
72
|
+
}
|
|
68
73
|
</style>
|
|
@@ -31,6 +31,8 @@ const { pressAndHold, stop } = usePressAndHold();
|
|
|
31
31
|
appearance="minimal"
|
|
32
32
|
icon="chevron-up"
|
|
33
33
|
variant="subdued"
|
|
34
|
+
size="xs"
|
|
35
|
+
pill
|
|
34
36
|
:disabled="isAtMax || disabled"
|
|
35
37
|
@mousedown="pressAndHold(increase)"
|
|
36
38
|
@mouseup="stop"
|
|
@@ -40,6 +42,8 @@ const { pressAndHold, stop } = usePressAndHold();
|
|
|
40
42
|
appearance="minimal"
|
|
41
43
|
icon="chevron-down"
|
|
42
44
|
variant="subdued"
|
|
45
|
+
size="xs"
|
|
46
|
+
pill
|
|
43
47
|
:disabled="isAtMin || disabled"
|
|
44
48
|
@mousedown="pressAndHold(decrease)"
|
|
45
49
|
@mouseup="stop"
|
|
@@ -52,10 +56,14 @@ const { pressAndHold, stop } = usePressAndHold();
|
|
|
52
56
|
<style scoped>
|
|
53
57
|
.vertical :deep(.controls) {
|
|
54
58
|
flex-direction: column;
|
|
55
|
-
justify-content:
|
|
59
|
+
justify-content: center;
|
|
60
|
+
gap: 0;
|
|
56
61
|
right: 3px;
|
|
57
62
|
left: auto;
|
|
58
63
|
}
|
|
64
|
+
.vertical :deep(.controls button) {
|
|
65
|
+
padding-block: 0;
|
|
66
|
+
}
|
|
59
67
|
.vertical :deep(.slot-wrapper) {
|
|
60
68
|
line-height: 0;
|
|
61
69
|
}
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
kind: composable
|
|
3
3
|
category: Composables
|
|
4
4
|
purpose: control size tokens, sizing tokens for form controls, control variant sizing
|
|
5
|
-
short: provide/inject `ControlSize` (sm/md/lg/xl) and read a CSS-var token bag for the active size
|
|
5
|
+
short: provide/inject `ControlSize` (xs/sm/md/lg/xl) and read a CSS-var token bag for the active size
|
|
6
6
|
invariants: true
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
# useControlSize โ agent-only invariants
|
|
10
10
|
|
|
11
11
|
This composable owns the **CSS variable bag** that maps a `ControlSize`
|
|
12
|
-
(`sm` / `md` / `lg` / `xl`) to concrete padding, font, gap, radius, and
|
|
12
|
+
(`xs` / `sm` / `md` / `lg` / `xl`) to concrete padding, font, gap, radius, and
|
|
13
13
|
icon-size tokens. Used internally by ControlElement and friends.
|
|
14
14
|
|
|
15
15
|
## Invariants
|
|
@@ -6,6 +6,18 @@ import {
|
|
|
6
6
|
} from "vue";
|
|
7
7
|
const CONTROL_SIZE_KEY = Symbol("control-size");
|
|
8
8
|
const sizeTokens = {
|
|
9
|
+
xs: {
|
|
10
|
+
"--control-font-size": "var(--font-sm)",
|
|
11
|
+
"--control-label-font-size": "var(--font-xs)",
|
|
12
|
+
"--control-py": "0.125rem",
|
|
13
|
+
"--control-px": "0.25rem",
|
|
14
|
+
"--control-gap": "0.125rem",
|
|
15
|
+
"--control-radius": "var(--border-radius-sm)",
|
|
16
|
+
"--control-icon-size": "0.625rem",
|
|
17
|
+
"--control-inner-block-start": "0.85rem",
|
|
18
|
+
"--control-inner-block-end": "0.1rem",
|
|
19
|
+
"--control-label-block-start": "0.15rem"
|
|
20
|
+
},
|
|
9
21
|
sm: {
|
|
10
22
|
"--control-font-size": "var(--font-sm)",
|
|
11
23
|
"--control-label-font-size": "var(--font-xs)",
|