@toife/vue 3.0.0 → 3.0.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 +54 -1
- package/package.json +4 -7
- package/src/components/action/action.md +115 -0
- package/src/components/action/action.scss +1 -2
- package/src/components/action/action.vue +9 -21
- package/src/components/app/app.md +77 -0
- package/src/components/app/app.scss +3 -3
- package/src/components/app/app.vue +1 -1
- package/src/components/avatar/avatar.md +64 -0
- package/src/components/avatar/avatar.scss +2 -2
- package/src/components/avatar/avatar.vue +1 -1
- package/src/components/button/button.md +66 -0
- package/src/components/button/button.scss +13 -13
- package/src/components/button/button.vue +6 -11
- package/src/components/cable/cable.md +57 -0
- package/src/components/cable/cable.vue +1 -1
- package/src/components/card/card/card.md +57 -0
- package/src/components/card/card/card.scss +3 -3
- package/src/components/card/card/card.vue +1 -1
- package/src/components/card/card-body/card-body.md +34 -0
- package/src/components/card/card-body/card-body.scss +3 -3
- package/src/components/card/card-body/card-body.vue +3 -8
- package/src/components/card/card-footer/card-footer.md +42 -0
- package/src/components/card/card-footer/card-footer.scss +4 -4
- package/src/components/card/card-footer/card-footer.vue +2 -5
- package/src/components/card/card-header/card-header.md +44 -0
- package/src/components/card/card-header/card-header.scss +4 -4
- package/src/components/card/card-header/card-header.vue +2 -5
- package/src/components/checkbox/checkbox.md +60 -0
- package/src/components/checkbox/checkbox.scss +8 -8
- package/src/components/checkbox/checkbox.vue +11 -24
- package/src/components/collapse/collapse.md +59 -0
- package/src/components/collapse/collapse.scss +2 -2
- package/src/components/collapse/collapse.vue +1 -1
- package/src/components/container/container.md +38 -0
- package/src/components/container/container.vue +3 -8
- package/src/components/decision-modal/decision-modal.md +79 -0
- package/src/components/decision-modal/decision-modal.scss +3 -3
- package/src/components/decision-modal/decision-modal.vue +1 -1
- package/src/components/divider/divider.md +42 -0
- package/src/components/divider/divider.scss +1 -1
- package/src/components/divider/divider.vue +3 -6
- package/src/components/field/field.md +68 -0
- package/src/components/field/outline/outline-field.md +44 -0
- package/src/components/field/outline/outline.scss +8 -8
- package/src/components/field/outline/outline.vue +2 -2
- package/src/components/form-group/form-group.md +41 -0
- package/src/components/gesture-indicator/gesture-indicator.md +42 -0
- package/src/components/gesture-indicator/gesture-indicator.scss +2 -2
- package/src/components/gesture-indicator/gesture-indicator.vue +3 -6
- package/src/components/image/image.md +41 -0
- package/src/components/modal/modal.md +65 -0
- package/src/components/modal/modal.scss +2 -2
- package/src/components/modal/modal.vue +1 -1
- package/src/components/page/page.md +39 -0
- package/src/components/page/page.vue +3 -8
- package/src/components/present/present.md +60 -0
- package/src/components/present/present.vue +1 -1
- package/src/components/radio/radio/radio.md +53 -0
- package/src/components/radio/radio/radio.scss +8 -8
- package/src/components/radio/radio/radio.vue +7 -11
- package/src/components/radio/radio-group/radio-group.md +62 -0
- package/src/components/radio/radio-group/radio-group.vue +1 -6
- package/src/components/refresher/refresher.md +53 -0
- package/src/components/route/route-navigator/route-navigator.md +50 -0
- package/src/components/route/route-navigator/route-navigator.scss +1 -1
- package/src/components/route/route-navigator/route-navigator.vue +14 -9
- package/src/components/route/route-outlet/route-outlet.md +30 -0
- package/src/components/route/route-provider/route-provider.md +46 -0
- package/src/components/route/route-wrapper/route-wrapper.composable.ts +29 -14
- package/src/components/route/route-wrapper/route-wrapper.md +45 -0
- package/src/components/route/route-wrapper/route-wrapper.type.ts +4 -0
- package/src/components/route/route-wrapper/route-wrapper.vue +13 -5
- package/src/components/route/route.type.ts +1 -0
- package/src/components/segmented-field/segmented-field.md +58 -0
- package/src/components/segmented-field/segmented-field.scss +3 -3
- package/src/components/segmented-field/segmented-field.vue +20 -26
- package/src/components/skeleton/skeleton.md +47 -0
- package/src/components/skeleton/skeleton.scss +3 -3
- package/src/components/skeleton/skeleton.vue +1 -1
- package/src/components/switch/switch.md +57 -0
- package/src/components/switch/switch.scss +8 -8
- package/src/components/switch/switch.vue +9 -20
- package/src/components/tabs/tab/tab.md +52 -0
- package/src/components/tabs/tabs/tabs.md +59 -0
- package/src/components/tabs/tabs/tabs.scss +4 -6
- package/src/components/tabs/tabs/tabs.vue +4 -6
- package/src/components/toast/toast/toast.md +56 -0
- package/src/components/toast/toast-content/toast-content.md +41 -0
- package/src/components/toast/toast-content/toast-content.scss +4 -4
- package/src/components/toast/toast-content/toast-content.vue +5 -11
- package/src/components/toolbar/toolbar.md +57 -0
- package/src/components/toolbar/toolbar.scss +2 -2
- package/src/components/toolbar/toolbar.vue +5 -11
- package/src/factory.ts +2 -0
- package/src/utils/element.md +33 -0
- package/src/utils/events.md +29 -0
- package/src/utils/style.md +49 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# `<t-cable>`
|
|
2
|
+
|
|
3
|
+
> Default prefix is `t-` — change via `createToife({ prefix: "..." })`.
|
|
4
|
+
|
|
5
|
+
## Description
|
|
6
|
+
|
|
7
|
+
Layout region for dock-style UI; provides `placement` to descendants (e.g. `Toolbar`) via inject.
|
|
8
|
+
|
|
9
|
+
## Requirements / dependencies
|
|
10
|
+
|
|
11
|
+
| Item | Notes |
|
|
12
|
+
| ----- | ---------------------------------------------------- |
|
|
13
|
+
| Vue | ^3.5 |
|
|
14
|
+
| Other | Toolbar is often placed inside to inherit placement. |
|
|
15
|
+
|
|
16
|
+
## Basic usage
|
|
17
|
+
|
|
18
|
+
```vue
|
|
19
|
+
<t-cable placement="bottom">
|
|
20
|
+
<t-toolbar><t-button>Home</t-button></t-toolbar>
|
|
21
|
+
</t-cable>
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Props
|
|
25
|
+
|
|
26
|
+
| Prop | Type | Default | Description |
|
|
27
|
+
| ----------- | --------- | ---------- | --------------------------------------- |
|
|
28
|
+
| `keyboard` | `boolean` | `false` | Reserved for keyboard-related behavior. |
|
|
29
|
+
| `placement` | `string` | `"bottom"` | Cable placement (class on root). |
|
|
30
|
+
|
|
31
|
+
**Type source:** `src/components/cable/cable.type.ts`
|
|
32
|
+
|
|
33
|
+
## Events (emits)
|
|
34
|
+
|
|
35
|
+
_None._
|
|
36
|
+
|
|
37
|
+
## Slots
|
|
38
|
+
|
|
39
|
+
| Slot | Description |
|
|
40
|
+
| --------- | ------------------------------ |
|
|
41
|
+
| `default` | Content (toolbar, buttons, …). |
|
|
42
|
+
|
|
43
|
+
## Provide / inject
|
|
44
|
+
|
|
45
|
+
`provide(CABLE_PROVIDER_STATE_KEY)`: `{ placement }` — `Toolbar` injects it for placement classes.
|
|
46
|
+
|
|
47
|
+
## Expose
|
|
48
|
+
|
|
49
|
+
Nothing.
|
|
50
|
+
|
|
51
|
+
## Style / class notes
|
|
52
|
+
|
|
53
|
+
Classes: `layer`, `base`, `cable`, plus placement.
|
|
54
|
+
|
|
55
|
+
## See also
|
|
56
|
+
|
|
57
|
+
- Source: `src/components/cable`
|
|
@@ -21,7 +21,7 @@ const { placement } = toRefs(props);
|
|
|
21
21
|
/// ------------------------------------------------------------
|
|
22
22
|
const cableAttrs = computed(() => {
|
|
23
23
|
return {
|
|
24
|
-
class: [withPrefix(["layer", "
|
|
24
|
+
class: [withPrefix(["layer", "cable"]), withPrefix("cable"), placement.value],
|
|
25
25
|
};
|
|
26
26
|
});
|
|
27
27
|
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# `<t-card>`
|
|
2
|
+
|
|
3
|
+
> Default prefix is `t-` — change via `createToife({ prefix: "..." })`.
|
|
4
|
+
|
|
5
|
+
## Description
|
|
6
|
+
|
|
7
|
+
Card surface with optional divider; provides context for `CardHeader` / `CardBody` / `CardFooter`.
|
|
8
|
+
|
|
9
|
+
## Requirements / dependencies
|
|
10
|
+
|
|
11
|
+
| Item | Notes |
|
|
12
|
+
| ----- | -------------------- |
|
|
13
|
+
| Vue | ^3.5 |
|
|
14
|
+
| Other | `t-app` recommended. |
|
|
15
|
+
|
|
16
|
+
## Basic usage
|
|
17
|
+
|
|
18
|
+
```vue
|
|
19
|
+
<t-card>
|
|
20
|
+
<t-card-header>Title</t-card-header>
|
|
21
|
+
<t-card-body>Content</t-card-body>
|
|
22
|
+
<t-card-footer>Footer</t-card-footer>
|
|
23
|
+
</t-card>
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Props
|
|
27
|
+
|
|
28
|
+
| Prop | Type | Default | Description |
|
|
29
|
+
| --------- | --------- | ------- | ----------------------------------- |
|
|
30
|
+
| `role` | `string` | — | Default from app. |
|
|
31
|
+
| `shape` | `string` | — | Default from app. |
|
|
32
|
+
| `divider` | `boolean` | — | Section dividers; default from app. |
|
|
33
|
+
|
|
34
|
+
**Type source:** `src/components/card/card/card.type.ts`
|
|
35
|
+
|
|
36
|
+
## Events (emits)
|
|
37
|
+
|
|
38
|
+
_None._
|
|
39
|
+
|
|
40
|
+
## Slots
|
|
41
|
+
|
|
42
|
+
| Slot | Description |
|
|
43
|
+
| --------- | ----------------- |
|
|
44
|
+
| `default` | Entire card body. |
|
|
45
|
+
|
|
46
|
+
## Provide / inject
|
|
47
|
+
|
|
48
|
+
`provide(CARD_PROVIDER_STATE_KEY)`: `{ role, shape, divider }` for header/footer.
|
|
49
|
+
|
|
50
|
+
## Expose
|
|
51
|
+
|
|
52
|
+
Nothing.
|
|
53
|
+
|
|
54
|
+
## See also
|
|
55
|
+
|
|
56
|
+
- Source: `src/components/card/card`
|
|
57
|
+
- [card-header.md](../card-header/card-header.md), [card-body.md](../card-body/card-body.md), [card-footer.md](../card-footer/card-footer.md)
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
// Class name
|
|
4
4
|
$card: sass.fn-naming-prefix("card");
|
|
5
5
|
|
|
6
|
-
// Property name - layer:
|
|
7
|
-
$background-color: sass.fn-naming-var("
|
|
8
|
-
$color: sass.fn-naming-var("
|
|
6
|
+
// Property name - layer: card
|
|
7
|
+
$background-color: sass.fn-naming-var("card", "background-color");
|
|
8
|
+
$color: sass.fn-naming-var("card", "color");
|
|
9
9
|
$border-radius: sass.fn-naming-var("border-radius");
|
|
10
10
|
$transition-duration: sass.fn-naming-var("motion", "duration");
|
|
11
11
|
|
|
@@ -33,7 +33,7 @@ const role = computed(() => {
|
|
|
33
33
|
const cardAttrs = computed(() => {
|
|
34
34
|
return {
|
|
35
35
|
class: [
|
|
36
|
-
withPrefix(["layer", "
|
|
36
|
+
withPrefix(["layer", "card"]),
|
|
37
37
|
withPrefix(["role", role.value]),
|
|
38
38
|
withPrefix(["shape", shape.value]),
|
|
39
39
|
withPrefix("card"),
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# `<t-card-body>`
|
|
2
|
+
|
|
3
|
+
> Default prefix is `t-` — change via `createToife({ prefix: "..." })`.
|
|
4
|
+
|
|
5
|
+
## Description
|
|
6
|
+
|
|
7
|
+
Main content region of a card.
|
|
8
|
+
|
|
9
|
+
## Requirements / dependencies
|
|
10
|
+
|
|
11
|
+
| Item | Notes |
|
|
12
|
+
| ----- | ------------------------ |
|
|
13
|
+
| Vue | ^3.5 |
|
|
14
|
+
| Other | Usually inside `t-card`. |
|
|
15
|
+
|
|
16
|
+
## Basic usage
|
|
17
|
+
|
|
18
|
+
```vue
|
|
19
|
+
<t-card-body>Main content</t-card-body>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Props
|
|
23
|
+
|
|
24
|
+
_None._
|
|
25
|
+
|
|
26
|
+
## Slots
|
|
27
|
+
|
|
28
|
+
| Slot | Description |
|
|
29
|
+
| --------- | ----------- |
|
|
30
|
+
| `default` | Content. |
|
|
31
|
+
|
|
32
|
+
## See also
|
|
33
|
+
|
|
34
|
+
- Source: `src/components/card/card-body`
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
// Class name
|
|
4
4
|
$card-body: sass.fn-naming-prefix("card-body");
|
|
5
5
|
|
|
6
|
-
// Property name - layer:
|
|
7
|
-
$background-color: sass.fn-naming-var("
|
|
8
|
-
$color: sass.fn-naming-var("
|
|
6
|
+
// Property name - layer: card
|
|
7
|
+
$background-color: sass.fn-naming-var("card", "background-color");
|
|
8
|
+
$color: sass.fn-naming-var("card", "color");
|
|
9
9
|
$padding-y: sass.fn-naming-var("spacing", "y");
|
|
10
10
|
$padding-x: sass.fn-naming-var("spacing", "x");
|
|
11
11
|
$transition-duration: sass.fn-naming-var("motion", "duration");
|
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
<style lang="scss" src="./card-body.scss"></style>
|
|
2
2
|
<template src="./card-body.html"></template>
|
|
3
3
|
<script lang="ts" setup>
|
|
4
|
-
import { computed } from "vue";
|
|
5
4
|
import { withPrefix } from "../../../utils";
|
|
6
5
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
return {
|
|
11
|
-
class: [withPrefix("card-body")],
|
|
12
|
-
};
|
|
13
|
-
});
|
|
6
|
+
const cardBodyAttrs = {
|
|
7
|
+
class: [withPrefix("card-body")],
|
|
8
|
+
} as const;
|
|
14
9
|
</script>
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# `<t-card-footer>`
|
|
2
|
+
|
|
3
|
+
> Default prefix is `t-` — change via `createToife({ prefix: "..." })`.
|
|
4
|
+
|
|
5
|
+
## Description
|
|
6
|
+
|
|
7
|
+
Card footer region; divider follows `t-card` context.
|
|
8
|
+
|
|
9
|
+
## Requirements / dependencies
|
|
10
|
+
|
|
11
|
+
| Item | Notes |
|
|
12
|
+
| ----- | --------------------------------------------- |
|
|
13
|
+
| Vue | ^3.5 |
|
|
14
|
+
| Other | Should be inside `t-card` for correct inject. |
|
|
15
|
+
|
|
16
|
+
## Basic usage
|
|
17
|
+
|
|
18
|
+
```vue
|
|
19
|
+
<t-card>
|
|
20
|
+
<t-card-footer>
|
|
21
|
+
<t-button>OK</t-button>
|
|
22
|
+
</t-card-footer>
|
|
23
|
+
</t-card>
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Props
|
|
27
|
+
|
|
28
|
+
_None._
|
|
29
|
+
|
|
30
|
+
## Slots
|
|
31
|
+
|
|
32
|
+
| Slot | Description |
|
|
33
|
+
| --------- | --------------- |
|
|
34
|
+
| `default` | Footer content. |
|
|
35
|
+
|
|
36
|
+
## Provide / inject
|
|
37
|
+
|
|
38
|
+
Injects `CardProviderState` from `t-card`.
|
|
39
|
+
|
|
40
|
+
## See also
|
|
41
|
+
|
|
42
|
+
- Source: `src/components/card/card-footer`
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
// Class name
|
|
4
4
|
$card-footer: sass.fn-naming-prefix("card-footer");
|
|
5
5
|
|
|
6
|
-
// Property name - layer:
|
|
7
|
-
$background-color: sass.fn-naming-var("
|
|
8
|
-
$color: sass.fn-naming-var("
|
|
6
|
+
// Property name - layer: card
|
|
7
|
+
$background-color: sass.fn-naming-var("card", "background-color");
|
|
8
|
+
$color: sass.fn-naming-var("card", "color");
|
|
9
9
|
$padding-y: sass.fn-naming-var("spacing", "y");
|
|
10
10
|
$padding-x: sass.fn-naming-var("spacing", "x");
|
|
11
|
-
$border-color: sass.fn-naming-var("
|
|
11
|
+
$border-color: sass.fn-naming-var("card", "border-color");
|
|
12
12
|
$border-width: sass.fn-naming-var("stroke", "width");
|
|
13
13
|
$border: #{$border-width} solid transparent;
|
|
14
14
|
$transition-duration: sass.fn-naming-var("motion", "duration");
|
|
@@ -11,16 +11,13 @@ const cardProviderState = inject<CardProviderState>(CARD_PROVIDER_STATE_KEY);
|
|
|
11
11
|
|
|
12
12
|
/// Computed
|
|
13
13
|
/// ------------------------------------------------------------
|
|
14
|
-
const divider = computed(() => {
|
|
15
|
-
return cardProviderState?.divider.value ?? false;
|
|
16
|
-
});
|
|
17
|
-
|
|
18
14
|
const cardFooterAttrs = computed(() => {
|
|
15
|
+
const divider = cardProviderState?.divider.value ?? false;
|
|
19
16
|
return {
|
|
20
17
|
class: [
|
|
21
18
|
withPrefix("card-footer"),
|
|
22
19
|
{
|
|
23
|
-
divider
|
|
20
|
+
divider,
|
|
24
21
|
},
|
|
25
22
|
],
|
|
26
23
|
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# `<t-card-header>`
|
|
2
|
+
|
|
3
|
+
> Default prefix is `t-` — change via `createToife({ prefix: "..." })`.
|
|
4
|
+
|
|
5
|
+
## Description
|
|
6
|
+
|
|
7
|
+
Card header region; divider follows context from `t-card`.
|
|
8
|
+
|
|
9
|
+
## Requirements / dependencies
|
|
10
|
+
|
|
11
|
+
| Item | Notes |
|
|
12
|
+
| ----- | ------------------------------------------------------------ |
|
|
13
|
+
| Vue | ^3.5 |
|
|
14
|
+
| Other | Must be inside `t-card` (injects `CARD_PROVIDER_STATE_KEY`). |
|
|
15
|
+
|
|
16
|
+
## Basic usage
|
|
17
|
+
|
|
18
|
+
```vue
|
|
19
|
+
<t-card>
|
|
20
|
+
<t-card-header>Title</t-card-header>
|
|
21
|
+
</t-card>
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Props
|
|
25
|
+
|
|
26
|
+
_No own props._
|
|
27
|
+
|
|
28
|
+
## Events (emits)
|
|
29
|
+
|
|
30
|
+
_None._
|
|
31
|
+
|
|
32
|
+
## Slots
|
|
33
|
+
|
|
34
|
+
| Slot | Description |
|
|
35
|
+
| --------- | --------------- |
|
|
36
|
+
| `default` | Header content. |
|
|
37
|
+
|
|
38
|
+
## Provide / inject
|
|
39
|
+
|
|
40
|
+
Injects `CardProviderState` from `t-card`.
|
|
41
|
+
|
|
42
|
+
## See also
|
|
43
|
+
|
|
44
|
+
- Source: `src/components/card/card-header`
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
// Class name
|
|
4
4
|
$card-header: sass.fn-naming-prefix("card-header");
|
|
5
5
|
|
|
6
|
-
// Property name - layer:
|
|
7
|
-
$background-color: sass.fn-naming-var("
|
|
8
|
-
$color: sass.fn-naming-var("
|
|
6
|
+
// Property name - layer: card
|
|
7
|
+
$background-color: sass.fn-naming-var("card", "background-color");
|
|
8
|
+
$color: sass.fn-naming-var("card", "color");
|
|
9
9
|
$padding-y: sass.fn-naming-var("spacing", "y");
|
|
10
10
|
$padding-x: sass.fn-naming-var("spacing", "x");
|
|
11
|
-
$border-color: sass.fn-naming-var("
|
|
11
|
+
$border-color: sass.fn-naming-var("card", "border-color");
|
|
12
12
|
$border-width: sass.fn-naming-var("stroke", "width");
|
|
13
13
|
$border: #{$border-width} solid transparent;
|
|
14
14
|
$transition-duration: sass.fn-naming-var("motion", "duration");
|
|
@@ -11,16 +11,13 @@ const cardProviderState = inject<CardProviderState>(CARD_PROVIDER_STATE_KEY);
|
|
|
11
11
|
|
|
12
12
|
/// Computed
|
|
13
13
|
/// ------------------------------------------------------------
|
|
14
|
-
const divider = computed(() => {
|
|
15
|
-
return cardProviderState?.divider.value ?? false;
|
|
16
|
-
});
|
|
17
|
-
|
|
18
14
|
const cardHeaderAttrs = computed(() => {
|
|
15
|
+
const divider = cardProviderState?.divider.value ?? false;
|
|
19
16
|
return {
|
|
20
17
|
class: [
|
|
21
18
|
withPrefix("card-header"),
|
|
22
19
|
{
|
|
23
|
-
divider
|
|
20
|
+
divider,
|
|
24
21
|
},
|
|
25
22
|
],
|
|
26
23
|
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# `<t-checkbox>`
|
|
2
|
+
|
|
3
|
+
> Default prefix is `t-` — change via `createToife({ prefix: "..." })`.
|
|
4
|
+
|
|
5
|
+
## Description
|
|
6
|
+
|
|
7
|
+
Custom boolean checkbox (not a native `<input type="checkbox">`), with `v-model` and readonly/disabled states.
|
|
8
|
+
|
|
9
|
+
## Requirements / dependencies
|
|
10
|
+
|
|
11
|
+
| Item | Notes |
|
|
12
|
+
| ----- | -------------------- |
|
|
13
|
+
| Vue | ^3.5 |
|
|
14
|
+
| Other | `t-app` recommended. |
|
|
15
|
+
|
|
16
|
+
## Basic usage
|
|
17
|
+
|
|
18
|
+
```vue
|
|
19
|
+
<t-checkbox v-model="checked">I agree</t-checkbox>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Props
|
|
23
|
+
|
|
24
|
+
| Prop | Type | Default | Description |
|
|
25
|
+
| ------------ | --------------------- | -------- | ------------------------ |
|
|
26
|
+
| `modelValue` | `boolean` | `false` | Value (`v-model`). |
|
|
27
|
+
| `role` | `string` | — | Theme; default from app. |
|
|
28
|
+
| `shape` | `string` | — | Shape; default from app. |
|
|
29
|
+
| `variant` | `"fill" \| "outline"` | `"fill"` | Visual variant. |
|
|
30
|
+
| `readonly` | `boolean` | `false` | Read-only. |
|
|
31
|
+
| `disabled` | `boolean` | `false` | Disabled. |
|
|
32
|
+
| `shadow` | `boolean` | — | Default from app. |
|
|
33
|
+
|
|
34
|
+
**Type source:** `src/components/checkbox/checkbox.type.ts`
|
|
35
|
+
|
|
36
|
+
## Events (emits)
|
|
37
|
+
|
|
38
|
+
| Event | Payload | Description |
|
|
39
|
+
| ------------------- | --------- | ------------------------------------- |
|
|
40
|
+
| `update:modelValue` | `boolean` | Updates `v-model`. |
|
|
41
|
+
| `focus` | — | When focused (not disabled/readonly). |
|
|
42
|
+
| `blur` | — | When blurred. |
|
|
43
|
+
|
|
44
|
+
## Slots
|
|
45
|
+
|
|
46
|
+
| Slot | Description |
|
|
47
|
+
| --------- | ----------------------- |
|
|
48
|
+
| `default` | Label next to the icon. |
|
|
49
|
+
|
|
50
|
+
## `v-model`
|
|
51
|
+
|
|
52
|
+
`modelValue` / `update:modelValue`.
|
|
53
|
+
|
|
54
|
+
## Accessibility (a11y)
|
|
55
|
+
|
|
56
|
+
`role="checkbox"`, `aria-checked`, `tabindex` 0 or -1; Space/Enter toggles.
|
|
57
|
+
|
|
58
|
+
## See also
|
|
59
|
+
|
|
60
|
+
- Source: `src/components/checkbox`
|
|
@@ -7,16 +7,16 @@ $shape-rounded: sass.fn-naming-prefix("shape-rounded");
|
|
|
7
7
|
$shape-pill: sass.fn-naming-prefix("shape-pill");
|
|
8
8
|
|
|
9
9
|
// Properties - layer: item
|
|
10
|
-
$background-color: sass.fn-naming-var("
|
|
11
|
-
$background-color-hover: sass.fn-naming-var("
|
|
12
|
-
$background-color-inactive: sass.fn-naming-var("
|
|
13
|
-
$background-color-contrast: sass.fn-naming-var("
|
|
14
|
-
$background-color-disabled: sass.fn-naming-var("
|
|
10
|
+
$background-color: sass.fn-naming-var("checkbox", "background-color");
|
|
11
|
+
$background-color-hover: sass.fn-naming-var("checkbox", "background-color", "soft");
|
|
12
|
+
$background-color-inactive: sass.fn-naming-var("checkbox", "background-color", "soft");
|
|
13
|
+
$background-color-contrast: sass.fn-naming-var("checkbox", "background-color", "contrast");
|
|
14
|
+
$background-color-disabled: sass.fn-naming-var("checkbox", "background-color", "subtle");
|
|
15
15
|
|
|
16
|
-
$color: sass.fn-naming-var("
|
|
16
|
+
$color: sass.fn-naming-var("checkbox", "color");
|
|
17
17
|
|
|
18
|
-
$border-color: sass.fn-naming-var("
|
|
19
|
-
$border-color-inactive: sass.fn-naming-var("
|
|
18
|
+
$border-color: sass.fn-naming-var("checkbox", "border-color");
|
|
19
|
+
$border-color-inactive: sass.fn-naming-var("checkbox", "border-color", "subtle");
|
|
20
20
|
|
|
21
21
|
$transition-duration: sass.fn-naming-var("motion", "duration");
|
|
22
22
|
$border-radius: sass.fn-naming-var("border-radius");
|
|
@@ -24,45 +24,32 @@ const isFocused = ref(false);
|
|
|
24
24
|
|
|
25
25
|
/// Computed
|
|
26
26
|
/// ------------------------------------------------------------
|
|
27
|
-
const role = computed(() => {
|
|
28
|
-
return props.role || appState?.role.value || "";
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
const shape = computed(() => {
|
|
32
|
-
return props.shape || appState?.shape.value || "";
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
const shadow = computed(() => {
|
|
36
|
-
return (props?.shadow !== undefined ? props.shadow : appState?.shadow.value) ?? false;
|
|
37
|
-
});
|
|
38
|
-
|
|
39
27
|
const checkboxAttrs = computed(() => {
|
|
28
|
+
const baseRole = appState?.role.value || "";
|
|
29
|
+
const role = props.role || baseRole;
|
|
30
|
+
const shape = props.shape || appState?.shape.value || "";
|
|
31
|
+
const shadow = (props?.shadow !== undefined ? props.shadow : appState?.shadow.value) ?? false;
|
|
40
32
|
return {
|
|
41
33
|
class: [
|
|
42
|
-
withPrefix(["layer", "
|
|
43
|
-
withPrefix([
|
|
44
|
-
|
|
45
|
-
props.modelValue && !props.disabled ? role.value : appState?.role.value || "",
|
|
46
|
-
]),
|
|
47
|
-
withPrefix(["shape", shape.value]),
|
|
34
|
+
withPrefix(["layer", "checkbox"]),
|
|
35
|
+
withPrefix(["role", props.modelValue && !props.disabled ? role : baseRole]),
|
|
36
|
+
withPrefix(["shape", shape]),
|
|
48
37
|
withPrefix("checkbox"),
|
|
49
38
|
props.variant,
|
|
50
39
|
{
|
|
51
40
|
on: props.modelValue,
|
|
52
41
|
disabled: props.disabled,
|
|
53
42
|
readonly: props.readonly,
|
|
54
|
-
shadow
|
|
43
|
+
shadow,
|
|
55
44
|
focus: isFocused.value,
|
|
56
45
|
},
|
|
57
46
|
],
|
|
58
47
|
};
|
|
59
48
|
});
|
|
60
49
|
|
|
61
|
-
const checkboxIconAttrs =
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
};
|
|
65
|
-
});
|
|
50
|
+
const checkboxIconAttrs = {
|
|
51
|
+
class: [withPrefix("checkbox-icon")],
|
|
52
|
+
} as const;
|
|
66
53
|
|
|
67
54
|
/// Methods
|
|
68
55
|
/// ------------------------------------------------------------
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# `<t-collapse>`
|
|
2
|
+
|
|
3
|
+
> Default prefix is `t-` — change via `createToife({ prefix: "..." })`.
|
|
4
|
+
|
|
5
|
+
## Description
|
|
6
|
+
|
|
7
|
+
Expand/collapse panel with height animation; separate slots for trigger and content.
|
|
8
|
+
|
|
9
|
+
## Requirements / dependencies
|
|
10
|
+
|
|
11
|
+
| Item | Notes |
|
|
12
|
+
| ----- | -------------------- |
|
|
13
|
+
| Vue | ^3.5 |
|
|
14
|
+
| Other | `t-app` recommended. |
|
|
15
|
+
|
|
16
|
+
## Basic usage
|
|
17
|
+
|
|
18
|
+
```vue
|
|
19
|
+
<t-collapse v-model="open">
|
|
20
|
+
<template #trigger>Expand</template>
|
|
21
|
+
<p>Hidden content</p>
|
|
22
|
+
</t-collapse>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Props
|
|
26
|
+
|
|
27
|
+
| Prop | Type | Default | Description |
|
|
28
|
+
| ------------ | --------- | ------- | -------------------------------------------------- |
|
|
29
|
+
| `modelValue` | `boolean` | `false` | Open (`true`) / closed. |
|
|
30
|
+
| `duration` | `number` | — | Transition duration (ms), mapped to CSS variables. |
|
|
31
|
+
| `role` | `string` | — | Theme role. |
|
|
32
|
+
| `disabled` | `boolean` | `false` | Disables toggling. |
|
|
33
|
+
|
|
34
|
+
**Type source:** `src/components/collapse/collapse.type.ts`
|
|
35
|
+
|
|
36
|
+
## Events (emits)
|
|
37
|
+
|
|
38
|
+
| Event | Payload | Description |
|
|
39
|
+
| ------------------- | --------- | ------------- |
|
|
40
|
+
| `update:modelValue` | `boolean` | After toggle. |
|
|
41
|
+
|
|
42
|
+
## Slots
|
|
43
|
+
|
|
44
|
+
| Slot | Description |
|
|
45
|
+
| --------- | ----------------------------------- |
|
|
46
|
+
| `trigger` | Clickable header (`role="button"`). |
|
|
47
|
+
| `default` | Collapsible content. |
|
|
48
|
+
|
|
49
|
+
## `v-model`
|
|
50
|
+
|
|
51
|
+
`modelValue` / `update:modelValue`.
|
|
52
|
+
|
|
53
|
+
## Accessibility (a11y)
|
|
54
|
+
|
|
55
|
+
Trigger: `role="button"`, `aria-expanded`, `aria-disabled`; Enter/Space toggles.
|
|
56
|
+
|
|
57
|
+
## See also
|
|
58
|
+
|
|
59
|
+
- Source: `src/components/collapse`
|
|
@@ -13,8 +13,8 @@ $collapse-duration: sass.fn-naming-dvar(
|
|
|
13
13
|
sass.fn-naming-var("motion", "duration")
|
|
14
14
|
);
|
|
15
15
|
|
|
16
|
-
$background-color: sass.fn-naming-var("
|
|
17
|
-
$color: sass.fn-naming-var("
|
|
16
|
+
$background-color: sass.fn-naming-var("collapse", "background-color");
|
|
17
|
+
$color: sass.fn-naming-var("collapse", "color");
|
|
18
18
|
$transition-duration: sass.fn-naming-var("motion", "duration");
|
|
19
19
|
|
|
20
20
|
// Collapse
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# `<t-container>`
|
|
2
|
+
|
|
3
|
+
> Default prefix is `t-` — change via `createToife({ prefix: "..." })`.
|
|
4
|
+
|
|
5
|
+
## Description
|
|
6
|
+
|
|
7
|
+
Base layout block (`layer` + `container`) wrapping page content.
|
|
8
|
+
|
|
9
|
+
## Requirements / dependencies
|
|
10
|
+
|
|
11
|
+
| Item | Notes |
|
|
12
|
+
| ----- | ----- |
|
|
13
|
+
| Vue | ^3.5 |
|
|
14
|
+
| Other | None. |
|
|
15
|
+
|
|
16
|
+
## Basic usage
|
|
17
|
+
|
|
18
|
+
```vue
|
|
19
|
+
<t-page>
|
|
20
|
+
<t-container>
|
|
21
|
+
<p>Content</p>
|
|
22
|
+
</t-container>
|
|
23
|
+
</t-page>
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Props
|
|
27
|
+
|
|
28
|
+
_No props._
|
|
29
|
+
|
|
30
|
+
## Slots
|
|
31
|
+
|
|
32
|
+
| Slot | Description |
|
|
33
|
+
| --------- | ----------- |
|
|
34
|
+
| `default` | Content. |
|
|
35
|
+
|
|
36
|
+
## See also
|
|
37
|
+
|
|
38
|
+
- Source: `src/components/container`
|
|
@@ -2,13 +2,8 @@
|
|
|
2
2
|
<template src="./container.html"></template>
|
|
3
3
|
<script lang="ts" setup>
|
|
4
4
|
import { withPrefix } from "../../utils";
|
|
5
|
-
import { computed } from "vue";
|
|
6
5
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
return {
|
|
11
|
-
class: [withPrefix(["layer", "base"]), withPrefix("container")],
|
|
12
|
-
};
|
|
13
|
-
});
|
|
6
|
+
const containerAttrs = {
|
|
7
|
+
class: [withPrefix("container")],
|
|
8
|
+
} as const;
|
|
14
9
|
</script>
|