@toife/vue 3.1.2 → 3.1.3
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/package.json +1 -1
- package/src/components/action/action.html +1 -1
- package/src/components/divider/divider.md +6 -6
- package/src/components/divider/divider.type.ts +2 -2
- package/src/components/divider/divider.vue +2 -2
- package/src/components/divider/index.ts +1 -1
- package/src/components/form-group/form-group.md +4 -4
- package/src/components/form-group/form-group.type.ts +2 -2
- package/src/components/form-group/form-group.vue +2 -2
- package/src/components/layout/flex/flex.type.ts +3 -1
- package/src/components/layout/grid/grid.type.ts +1 -1
- package/src/components/radio/radio-group/index.ts +1 -1
- package/src/components/radio/radio-group/radio-group.md +10 -10
- package/src/components/radio/radio-group/radio-group.type.ts +2 -2
- package/src/components/radio/radio-group/radio-group.vue +2 -2
- package/src/components/toolbar/toolbar.html +1 -3
- package/src/components/toolbar/toolbar.md +5 -8
- package/src/components/toolbar/toolbar.scss +24 -39
- package/src/components/toolbar/toolbar.type.ts +1 -1
- package/src/components/toolbar/toolbar.vue +4 -4
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
>
|
|
8
8
|
<div v-bind="actionAttrs">
|
|
9
9
|
<slot name="body">
|
|
10
|
-
<FormGroup
|
|
10
|
+
<FormGroup direction="vertical" v-for="(buttons, groupIndex) in actions" :key="groupIndex">
|
|
11
11
|
<CustomButton
|
|
12
12
|
v-for="(btn, btnIndex) in buttons"
|
|
13
13
|
:key="`${groupIndex}-${btnIndex}`"
|
|
@@ -16,16 +16,16 @@ Horizontal or vertical divider line following theme.
|
|
|
16
16
|
## Basic usage
|
|
17
17
|
|
|
18
18
|
```vue
|
|
19
|
-
<t-divider
|
|
20
|
-
<t-divider
|
|
19
|
+
<t-divider direction="horizontal" />
|
|
20
|
+
<t-divider direction="vertical" />
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
## Props
|
|
24
24
|
|
|
25
|
-
| Prop
|
|
26
|
-
|
|
|
27
|
-
| `
|
|
28
|
-
| `role`
|
|
25
|
+
| Prop | Type | Default | Description |
|
|
26
|
+
| ----------- | ---------------------------- | -------------- | ------------------------------- |
|
|
27
|
+
| `direction` | `"horizontal" \| "vertical"` | `"horizontal"` | Divider direction. |
|
|
28
|
+
| `role` | `string` | — | Theme stroke; default from app. |
|
|
29
29
|
|
|
30
30
|
**Type source:** `src/components/divider/divider.type.ts`
|
|
31
31
|
|
|
@@ -9,7 +9,7 @@ import { type AppProviderState, APP_PROVIDER_STATE_KEY } from "../app";
|
|
|
9
9
|
// Component setup (props, emits, injects)
|
|
10
10
|
// ----------------------------------------------------------------------------
|
|
11
11
|
const props = withDefaults(defineProps<DividerProps>(), {
|
|
12
|
-
|
|
12
|
+
direction: "horizontal",
|
|
13
13
|
});
|
|
14
14
|
const appState = inject<AppProviderState>(APP_PROVIDER_STATE_KEY);
|
|
15
15
|
|
|
@@ -23,7 +23,7 @@ const dividerAttrs = computed(() => {
|
|
|
23
23
|
withPrefix(["role", role]),
|
|
24
24
|
withPrefix("divider"),
|
|
25
25
|
{
|
|
26
|
-
[props.
|
|
26
|
+
[props.direction]: true,
|
|
27
27
|
},
|
|
28
28
|
],
|
|
29
29
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { default as Divider } from "./divider.vue";
|
|
2
|
-
export type {
|
|
2
|
+
export type { DividerDirection, DividerProps } from "./divider.type";
|
|
@@ -16,7 +16,7 @@ Groups controls in a horizontal or vertical flex layout; used by `Action` to sta
|
|
|
16
16
|
## Basic usage
|
|
17
17
|
|
|
18
18
|
```vue
|
|
19
|
-
<t-form-group
|
|
19
|
+
<t-form-group direction="vertical">
|
|
20
20
|
<t-button>A</t-button>
|
|
21
21
|
<t-button>B</t-button>
|
|
22
22
|
</t-form-group>
|
|
@@ -24,9 +24,9 @@ Groups controls in a horizontal or vertical flex layout; used by `Action` to sta
|
|
|
24
24
|
|
|
25
25
|
## Props
|
|
26
26
|
|
|
27
|
-
| Prop
|
|
28
|
-
|
|
|
29
|
-
| `
|
|
27
|
+
| Prop | Type | Default | Description |
|
|
28
|
+
| ----------- | ---------------------------- | -------------- | ------------ |
|
|
29
|
+
| `direction` | `"horizontal" \| "vertical"` | `"horizontal"` | Layout axis. |
|
|
30
30
|
|
|
31
31
|
**Type source:** `src/components/form-group/form-group.type.ts`
|
|
32
32
|
|
|
@@ -8,14 +8,14 @@ import { type FormGroupProps } from "./form-group.type";
|
|
|
8
8
|
// Component setup (props, emits, injects)
|
|
9
9
|
// ----------------------------------------------------------------------------
|
|
10
10
|
const props = withDefaults(defineProps<FormGroupProps>(), {
|
|
11
|
-
|
|
11
|
+
direction: "horizontal",
|
|
12
12
|
});
|
|
13
13
|
|
|
14
14
|
// Computed properties
|
|
15
15
|
// ----------------------------------------------------------------------------
|
|
16
16
|
const formGroupAttrs = computed(() => {
|
|
17
17
|
return {
|
|
18
|
-
class: [withPrefix("form-group"), props.
|
|
18
|
+
class: [withPrefix("form-group"), props.direction],
|
|
19
19
|
};
|
|
20
20
|
});
|
|
21
21
|
</script>
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
export type FlexDirection = "row" | "column" | "row-reverse" | "column-reverse";
|
|
2
|
+
|
|
1
3
|
export type FlexOption = {
|
|
2
4
|
breakpoint?: string;
|
|
3
5
|
gap?: string | number;
|
|
4
|
-
direction?:
|
|
6
|
+
direction?: FlexDirection;
|
|
5
7
|
wrap?: string;
|
|
6
8
|
justify?: string;
|
|
7
9
|
align?: string;
|
|
@@ -2,6 +2,6 @@ export { default as RadioGroup } from "./radio-group.vue";
|
|
|
2
2
|
export type {
|
|
3
3
|
RadioGroupProps,
|
|
4
4
|
RadioGroupProviderState,
|
|
5
|
-
|
|
5
|
+
RadioGroupDirection,
|
|
6
6
|
} from "./radio-group.type";
|
|
7
7
|
export { RADIO_GROUP_PROVIDER_STATE_KEY } from "./radio-group.constants";
|
|
@@ -16,7 +16,7 @@ Radio group with shared `v-model`; provides variant/readonly/disabled/shadow to
|
|
|
16
16
|
## Basic usage
|
|
17
17
|
|
|
18
18
|
```vue
|
|
19
|
-
<t-radio-group v-model="choice"
|
|
19
|
+
<t-radio-group v-model="choice" direction="vertical">
|
|
20
20
|
<t-radio value="a">A</t-radio>
|
|
21
21
|
<t-radio value="b">B</t-radio>
|
|
22
22
|
</t-radio-group>
|
|
@@ -24,15 +24,15 @@ Radio group with shared `v-model`; provides variant/readonly/disabled/shadow to
|
|
|
24
24
|
|
|
25
25
|
## Props
|
|
26
26
|
|
|
27
|
-
| Prop
|
|
28
|
-
|
|
|
29
|
-
| `modelValue`
|
|
30
|
-
| `role`
|
|
31
|
-
| `variant`
|
|
32
|
-
| `disabled`
|
|
33
|
-
| `readonly`
|
|
34
|
-
| `shadow`
|
|
35
|
-
| `
|
|
27
|
+
| Prop | Type | Default | Description |
|
|
28
|
+
| ------------ | ---------------------------- | ------------ | ------------------------------------- |
|
|
29
|
+
| `modelValue` | `string \| number` | — | Selected value (`v-model`). |
|
|
30
|
+
| `role` | `string` | — | Theme; default from app. |
|
|
31
|
+
| `variant` | `RadioVariant` | `"fill"` | Default for radios unless overridden. |
|
|
32
|
+
| `disabled` | `boolean` | `false` | Whole group. |
|
|
33
|
+
| `readonly` | `boolean` | `false` | |
|
|
34
|
+
| `shadow` | `boolean` | — | Default from app. |
|
|
35
|
+
| `direction` | `"horizontal" \| "vertical"` | `"vertical"` | Flex layout. |
|
|
36
36
|
|
|
37
37
|
**Type source:** `src/components/radio/radio-group/radio-group.type.ts`
|
|
38
38
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ComputedRef } from "vue";
|
|
2
2
|
import type { RadioVariant } from "../radio/radio.type";
|
|
3
3
|
|
|
4
|
-
export type
|
|
4
|
+
export type RadioGroupDirection = "horizontal" | "vertical";
|
|
5
5
|
|
|
6
6
|
export type RadioGroupProps = {
|
|
7
7
|
modelValue?: string | number;
|
|
@@ -10,7 +10,7 @@ export type RadioGroupProps = {
|
|
|
10
10
|
disabled?: boolean;
|
|
11
11
|
readonly?: boolean;
|
|
12
12
|
shadow?: boolean;
|
|
13
|
-
|
|
13
|
+
direction?: RadioGroupDirection;
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
export type RadioGroupEmit = {
|
|
@@ -13,7 +13,7 @@ const props = withDefaults(defineProps<RadioGroupProps>(), {
|
|
|
13
13
|
disabled: false,
|
|
14
14
|
readonly: false,
|
|
15
15
|
variant: "fill",
|
|
16
|
-
|
|
16
|
+
direction: "vertical",
|
|
17
17
|
shadow: undefined,
|
|
18
18
|
});
|
|
19
19
|
const emit = defineEmits<RadioGroupEmit>();
|
|
@@ -37,7 +37,7 @@ const shadow = computed(() => {
|
|
|
37
37
|
|
|
38
38
|
const radioGroupAttrs = computed(() => {
|
|
39
39
|
return {
|
|
40
|
-
class: [withPrefix("radio-group"), props.
|
|
40
|
+
class: [withPrefix("radio-group"), props.direction],
|
|
41
41
|
};
|
|
42
42
|
});
|
|
43
43
|
|
|
@@ -25,12 +25,11 @@ Toolbar surface with height / safe-area; `placement` comes from props or from `t
|
|
|
25
25
|
|
|
26
26
|
## Props
|
|
27
27
|
|
|
28
|
-
| Prop | Type
|
|
29
|
-
| ----------- |
|
|
30
|
-
| `placement` | `string \| null`
|
|
31
|
-
| `safeArea` | `boolean`
|
|
32
|
-
| `
|
|
33
|
-
| `role` | `string` | — | Theme. |
|
|
28
|
+
| Prop | Type | Default | Description |
|
|
29
|
+
| ----------- | ---------------- | ------- | ------------------------------------------------- |
|
|
30
|
+
| `placement` | `string \| null` | `null` | Placement class; if null, uses `cable.placement`. |
|
|
31
|
+
| `safeArea` | `boolean` | `true` | Safe-area padding (notch, home indicator). |
|
|
32
|
+
| `role` | `string` | — | Theme. |
|
|
34
33
|
|
|
35
34
|
**Type source:** `src/components/toolbar/toolbar.type.ts`
|
|
36
35
|
|
|
@@ -50,8 +49,6 @@ Optional inject `CABLE_PROVIDER_STATE_KEY` and `APP_PROVIDER_STATE_KEY`.
|
|
|
50
49
|
|
|
51
50
|
## Style / class notes
|
|
52
51
|
|
|
53
|
-
Variable `--<prefix>-toolbar-size`; classes `with-safe-area`, placement.
|
|
54
|
-
|
|
55
52
|
## See also
|
|
56
53
|
|
|
57
54
|
- Source: `src/components/toolbar`
|
|
@@ -4,16 +4,21 @@
|
|
|
4
4
|
$toolbar: sass.fn-naming-prefix("toolbar");
|
|
5
5
|
|
|
6
6
|
// Property name - layer: toolbar
|
|
7
|
-
$toolbar-size: sass.fn-naming-var("toolbar", "size");
|
|
8
7
|
$toolbar-background-color: sass.fn-naming-var("toolbar", "background-color");
|
|
8
|
+
$toolbar-color: sass.fn-naming-var("toolbar", "color");
|
|
9
|
+
$toolbar-border-color: sass.fn-naming-var("toolbar", "border-color");
|
|
9
10
|
$safe-area-right: sass.fn-naming-var("safe-area", "right");
|
|
10
11
|
$safe-area-left: sass.fn-naming-var("safe-area", "left");
|
|
11
12
|
$safe-area-bottom: sass.fn-naming-var("safe-area", "bottom");
|
|
12
13
|
$safe-area-top: sass.fn-naming-var("safe-area", "top");
|
|
13
14
|
$transition-duration: sass.fn-naming-var("motion", "duration");
|
|
14
15
|
|
|
16
|
+
$border-width: sass.fn-naming-var("stroke", "width");
|
|
17
|
+
$border: #{$border-width} solid rgb(#{$toolbar-border-color});
|
|
18
|
+
|
|
15
19
|
.#{$toolbar} {
|
|
16
20
|
background-color: rgb(#{$toolbar-background-color});
|
|
21
|
+
color: rgb(#{$toolbar-color});
|
|
17
22
|
transition:
|
|
18
23
|
box-shadow #{$transition-duration} ease,
|
|
19
24
|
border-color #{$transition-duration} ease,
|
|
@@ -21,44 +26,6 @@ $transition-duration: sass.fn-naming-var("motion", "duration");
|
|
|
21
26
|
color #{$transition-duration} ease,
|
|
22
27
|
border-radius #{$transition-duration} ease;
|
|
23
28
|
|
|
24
|
-
> div {
|
|
25
|
-
align-items: center;
|
|
26
|
-
display: flex;
|
|
27
|
-
position: relative;
|
|
28
|
-
|
|
29
|
-
> * {
|
|
30
|
-
flex: 1;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
&.bottom,
|
|
35
|
-
&.top {
|
|
36
|
-
> div {
|
|
37
|
-
flex-direction: row;
|
|
38
|
-
height: #{$toolbar-size};
|
|
39
|
-
max-height: #{$toolbar-size};
|
|
40
|
-
width: 100%;
|
|
41
|
-
|
|
42
|
-
> * {
|
|
43
|
-
height: 100%;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
&.left,
|
|
49
|
-
&.right {
|
|
50
|
-
> div {
|
|
51
|
-
flex-direction: column;
|
|
52
|
-
width: #{$toolbar-size};
|
|
53
|
-
max-width: #{$toolbar-size};
|
|
54
|
-
height: 100%;
|
|
55
|
-
|
|
56
|
-
> * {
|
|
57
|
-
width: 100%;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
29
|
&.with-safe-area {
|
|
63
30
|
&.right {
|
|
64
31
|
padding-right: #{$safe-area-right};
|
|
@@ -76,4 +43,22 @@ $transition-duration: sass.fn-naming-var("motion", "duration");
|
|
|
76
43
|
padding-top: #{$safe-area-top};
|
|
77
44
|
}
|
|
78
45
|
}
|
|
46
|
+
|
|
47
|
+
&.divider {
|
|
48
|
+
&.bottom {
|
|
49
|
+
border-top: #{$border};
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
&.top {
|
|
53
|
+
border-bottom: #{$border};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
&.left {
|
|
57
|
+
border-right: #{$border};
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
&.right {
|
|
61
|
+
border-left: #{$border};
|
|
62
|
+
}
|
|
63
|
+
}
|
|
79
64
|
}
|
|
@@ -13,7 +13,7 @@ import { CABLE_PROVIDER_STATE_KEY } from "../cable";
|
|
|
13
13
|
const props = withDefaults(defineProps<ToolbarProps>(), {
|
|
14
14
|
placement: null,
|
|
15
15
|
safeArea: true,
|
|
16
|
-
|
|
16
|
+
divider: undefined,
|
|
17
17
|
});
|
|
18
18
|
const cable = inject<CableProviderState>(CABLE_PROVIDER_STATE_KEY);
|
|
19
19
|
const appState = inject<AppProviderState>(APP_PROVIDER_STATE_KEY);
|
|
@@ -23,6 +23,8 @@ const appState = inject<AppProviderState>(APP_PROVIDER_STATE_KEY);
|
|
|
23
23
|
const toolbarAttrs = computed(() => {
|
|
24
24
|
const role = props.role || appState?.role.value || "";
|
|
25
25
|
const placement = props.placement || cable?.placement.value || "";
|
|
26
|
+
const divider = (props?.divider !== undefined ? props.divider : appState?.divider.value) ?? false;
|
|
27
|
+
|
|
26
28
|
return {
|
|
27
29
|
class: [
|
|
28
30
|
withPrefix(["layer", "toolbar"]),
|
|
@@ -31,11 +33,9 @@ const toolbarAttrs = computed(() => {
|
|
|
31
33
|
placement,
|
|
32
34
|
{
|
|
33
35
|
"with-safe-area": props.safeArea,
|
|
36
|
+
divider: divider.value,
|
|
34
37
|
},
|
|
35
38
|
],
|
|
36
|
-
style: {
|
|
37
|
-
[property(["toolbar", "size"])]: props.size + (typeof props.size === "number" ? "px" : ""),
|
|
38
|
-
},
|
|
39
39
|
};
|
|
40
40
|
});
|
|
41
41
|
</script>
|