@axel669/zephyr 0.1.16 → 0.2.0-beta.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.
Files changed (113) hide show
  1. package/LICENSE +21 -21
  2. package/package.json +34 -30
  3. package/readme.md +55 -44
  4. package/src/composed/data-table/th.svelte +60 -0
  5. package/src/composed/data-table.md +71 -0
  6. package/src/composed/data-table.svelte +136 -150
  7. package/src/composed/entry-button.md +34 -0
  8. package/src/composed/entry-button.svelte +29 -68
  9. package/src/composed/table-functions.js +13 -0
  10. package/src/composed/toast/message.svelte +44 -44
  11. package/src/composed/toast.md +36 -0
  12. package/src/composed/toast.svelte +68 -108
  13. package/src/control/button.md +37 -0
  14. package/src/control/button.svelte +25 -0
  15. package/src/control/input.svelte +107 -0
  16. package/src/control/label.md +0 -0
  17. package/src/control/label.svelte +36 -0
  18. package/src/control/link.md +37 -0
  19. package/src/control/link.svelte +28 -0
  20. package/src/control/radio.md +49 -0
  21. package/src/control/radio.svelte +28 -0
  22. package/src/control/select.md +55 -0
  23. package/src/control/select.svelte +62 -0
  24. package/src/control/tabs.md +35 -0
  25. package/src/control/tabs.svelte +39 -0
  26. package/src/control/toggle.md +38 -0
  27. package/src/control/toggle.svelte +47 -0
  28. package/src/data-display/avatar.md +26 -0
  29. package/src/data-display/avatar.svelte +23 -0
  30. package/src/data-display/badge.md +24 -0
  31. package/src/data-display/badge.svelte +12 -0
  32. package/src/data-display/chip.md +28 -0
  33. package/src/data-display/chip.svelte +26 -0
  34. package/src/data-display/details.md +0 -0
  35. package/src/{details.svelte → data-display/details.svelte} +3 -3
  36. package/src/data-display/popover.md +32 -0
  37. package/src/data-display/popover.svelte +23 -0
  38. package/src/data-display/progress.md +30 -0
  39. package/src/data-display/progress.svelte +25 -0
  40. package/src/data-display/table.md +29 -0
  41. package/src/data-display/table.svelte +36 -0
  42. package/src/data-display/tooltip.md +25 -0
  43. package/src/data-display/tooltip.svelte +15 -0
  44. package/src/dialogs/alert.md +0 -0
  45. package/src/dialogs/alert.svelte +4 -4
  46. package/src/dialogs/confirm.md +0 -0
  47. package/src/dialogs/confirm.svelte +5 -5
  48. package/src/functions.md +77 -0
  49. package/src/handler$.mjs +20 -68
  50. package/src/index.mjs +55 -92
  51. package/src/info/icon.md +20 -0
  52. package/src/info/icon.svelte +9 -0
  53. package/src/info/notification.md +37 -0
  54. package/src/info/notification.svelte +16 -0
  55. package/src/info/titlebar.md +46 -0
  56. package/src/info/titlebar.svelte +18 -0
  57. package/src/info/toaster.md +23 -0
  58. package/src/info/toaster.svelte +14 -0
  59. package/src/inline-dialog.svelte +23 -23
  60. package/src/layout/dialog.md +33 -0
  61. package/src/layout/dialog.svelte +24 -0
  62. package/src/layout/drawer.md +47 -0
  63. package/src/layout/drawer.svelte +47 -0
  64. package/src/layout/flex.md +30 -0
  65. package/src/layout/flex.svelte +22 -0
  66. package/src/layout/grid.md +36 -0
  67. package/src/layout/grid.svelte +26 -0
  68. package/src/layout/modal.md +35 -0
  69. package/src/layout/modal.svelte +58 -0
  70. package/src/layout/paper.md +77 -0
  71. package/src/layout/paper.svelte +45 -0
  72. package/src/layout/screen.md +31 -0
  73. package/src/layout/screen.svelte +32 -0
  74. package/src/{circle-spinner.svelte → spinner/circle-spinner.svelte} +2 -2
  75. package/src/{hexagon-spinner.svelte → spinner/hexagon-spinner.svelte} +2 -2
  76. package/src/spinner/spinners.md +0 -0
  77. package/src/text.md +22 -0
  78. package/src/text.svelte +20 -49
  79. package/src/variant.mjs +12 -12
  80. package/src/wsx.mjs +24 -45
  81. package/src/avatar.svelte +0 -54
  82. package/src/badge.svelte +0 -40
  83. package/src/button.svelte +0 -86
  84. package/src/chip.svelte +0 -56
  85. package/src/dialog.svelte +0 -54
  86. package/src/drawer.svelte +0 -121
  87. package/src/flex.svelte +0 -57
  88. package/src/grid.svelte +0 -66
  89. package/src/icon.svelte +0 -34
  90. package/src/input/area.svelte +0 -98
  91. package/src/input/elems.mjs +0 -7
  92. package/src/input/email.svelte +0 -104
  93. package/src/input/file.svelte +0 -82
  94. package/src/input/number.svelte +0 -104
  95. package/src/input/password.svelte +0 -101
  96. package/src/input/search.svelte +0 -104
  97. package/src/input/text.svelte +0 -104
  98. package/src/link.svelte +0 -67
  99. package/src/modal.svelte +0 -73
  100. package/src/notification.svelte +0 -57
  101. package/src/paper.svelte +0 -127
  102. package/src/popover.svelte +0 -60
  103. package/src/progress.svelte +0 -60
  104. package/src/radio.svelte +0 -82
  105. package/src/screen.svelte +0 -69
  106. package/src/select.svelte +0 -122
  107. package/src/table.svelte +0 -69
  108. package/src/tabs.svelte +0 -78
  109. package/src/titlebar.svelte +0 -69
  110. package/src/toaster.svelte +0 -42
  111. package/src/toggle.svelte +0 -94
  112. package/src/tooltip.svelte +0 -45
  113. package/src/vars.mjs +0 -61
@@ -0,0 +1,34 @@
1
+ # EntryButton
2
+
3
+ The EntryButton is a convenient way to display modals and screens over
4
+ content without needing to bind variables have lots of Modal elements in
5
+ addition to the buttons that show them.
6
+
7
+ ## Props
8
+
9
+ - ### component
10
+ The component to show when clicked
11
+ - ### props
12
+ The props to pass to the component when it is shown, or a function that
13
+ generates the props when called
14
+ - ### this
15
+ The wrapper for the component. Default is Modal but any component that
16
+ has the same interface as Modal will work
17
+
18
+ ## Events
19
+ - ### entry
20
+ When the component is close the entry event is fired. The detail
21
+ property of the event will have the value from closing it
22
+
23
+ ## Usage
24
+ ```svelte
25
+ <EntryButton component={Subscreen} on:entry={console.log}>
26
+ Open Subscreen
27
+ </EntryButton>
28
+ <EntryButton component={CoolDialog} on:entry={console.log}>
29
+ Open Subscreen
30
+ </EntryButton>
31
+ <EntryButton this={CoolModal} component={CustomThing} on:entry={console.log}>
32
+ Open Subscreen
33
+ </EntryButton>
34
+ ```
@@ -1,68 +1,29 @@
1
- <script>
2
- /*md
3
- [@] Components/EntryButton
4
-
5
- # EntryButton
6
-
7
- The EntryButton is a convenient way to display modals and screens over
8
- content without needing to bind variables have lots of Modal elements in
9
- addition to the buttons that show them.
10
-
11
- ## Props
12
-
13
- - ### component
14
- The component to show when clicked
15
- - ### props
16
- The props to pass to the component when it is shown, or a function that
17
- generates the props when called
18
- - ### this
19
- The wrapper for the component. Default is Modal but any component that
20
- has the same interface as Modal will work
21
-
22
- ## Events
23
- - ### entry
24
- When the component is close the entry event is fired. The detail
25
- property of the event will have the value from closing it
26
-
27
- ## Usage
28
- ```svelte
29
- <EntryButton component={Subscreen} on:entry={console.log}>
30
- Open Subscreen
31
- </EntryButton>
32
- <EntryButton component={CoolDialog} on:entry={console.log}>
33
- Open Subscreen
34
- </EntryButton>
35
- <EntryButton this={CoolModal} component={CustomThing} on:entry={console.log}>
36
- Open Subscreen
37
- </EntryButton>
38
- ```
39
- */
40
-
41
- import { createEventDispatcher } from "svelte"
42
-
43
- import Button from "../button.svelte"
44
- import Modal from "../modal.svelte"
45
- import { handler$ } from "../handler$.mjs"
46
-
47
- export let component
48
- export let props
49
- let wrapper = Modal
50
- export { wrapper as this }
51
-
52
- const send = createEventDispatcher()
53
-
54
- let element = null
55
- const open = handler$(
56
- async (props) => {
57
- const elemProps = (typeof props === "function") ? props() : props
58
- const result = await element.show(elemProps)
59
- send("entry", result)
60
- }
61
- )
62
- </script>
63
-
64
- <Button {...$$restProps} on:click={open(props)}>
65
- <slot />
66
- </Button>
67
-
68
- <svelte:component this={wrapper} {component} bind:this={element} />
1
+ <script>
2
+ import { createEventDispatcher } from "svelte"
3
+
4
+ import Button from "../control/button.svelte"
5
+ import Modal from "../layout/modal.svelte"
6
+ import { handler$ } from "../handler$.mjs"
7
+
8
+ export let component
9
+ export let props
10
+ let wrapper = Modal
11
+ export { wrapper as this }
12
+
13
+ const send = createEventDispatcher()
14
+
15
+ let element = null
16
+ const open = handler$(
17
+ async (props) => {
18
+ const elemProps = (typeof props === "function") ? props() : props
19
+ const result = await element.show(elemProps)
20
+ send("entry", result)
21
+ }
22
+ )
23
+ </script>
24
+
25
+ <Button {...$$restProps} on:click={open(props)}>
26
+ <slot />
27
+ </Button>
28
+
29
+ <svelte:component this={wrapper} {component} bind:this={element} />
@@ -0,0 +1,13 @@
1
+ export const filters = {
2
+ text: (propName) =>
3
+ (row, text) =>
4
+ row[propName]
5
+ .toLowerCase()
6
+ .includes(text.toLowerCase())
7
+ }
8
+ export const sorts = {
9
+ natural: (propName) => {
10
+ const comparitor = new Intl.Collator(undefined, { numeric: true })
11
+ return (a, b) => comparitor.compare(a[propName], b[propName])
12
+ }
13
+ }
@@ -1,44 +1,44 @@
1
- <script>
2
- /*md
3
- [@] Components/ToastMessage
4
-
5
- # ToastMessage
6
-
7
- The default component for Toast to show messages with
8
-
9
- ## Props
10
- - ### actionText `string`
11
- If given, the message will have a button that can be clicked and will
12
- use this text for the button text
13
- - ### color `string`
14
- Sets `$color`
15
- - ### icon `string`
16
- An icon to show with the message
17
- - ### message `string`
18
- The message to show
19
- */
20
-
21
- import { createEventDispatcher } from "svelte"
22
-
23
- import Button from "../../button.svelte"
24
- import Icon from "../../icon.svelte"
25
- import Notification from "../../notification.svelte"
26
-
27
- export let message = ""
28
- export let icon = ""
29
- export let color = false
30
- export let actionText = null
31
-
32
- const dispatch = createEventDispatcher()
33
- const dismiss = () => dispatch("action", null)
34
- const respond = () => dispatch("action", true)
35
- </script>
36
-
37
- <Notification {color} on:click={dismiss}>
38
- <Icon name={icon}>{message}</Icon>
39
- {#if actionText}
40
- <Button {color} variant="fill" on:click={respond}>
41
- {actionText}
42
- </Button>
43
- {/if}
44
- </Notification>
1
+ <script>
2
+ /*md
3
+ [@] Components/ToastMessage
4
+
5
+ # ToastMessage
6
+
7
+ The default component for Toast to show messages with
8
+
9
+ ## Props
10
+ - ### actionText `string`
11
+ If given, the message will have a button that can be clicked and will
12
+ use this text for the button text
13
+ - ### color `string`
14
+ Sets `$color`
15
+ - ### icon `string`
16
+ An icon to show with the message
17
+ - ### message `string`
18
+ The message to show
19
+ */
20
+
21
+ import { createEventDispatcher } from "svelte"
22
+
23
+ import Button from "../../control/button.svelte"
24
+ import Icon from "../../info/icon.svelte"
25
+ import Notification from "../../info/notification.svelte"
26
+
27
+ export let message = ""
28
+ export let icon = ""
29
+ export let color = false
30
+ export let actionText = null
31
+
32
+ const dispatch = createEventDispatcher()
33
+ const dismiss = () => dispatch("action", null)
34
+ const respond = () => dispatch("action", true)
35
+ </script>
36
+
37
+ <Notification {color} on:click={dismiss}>
38
+ <Icon name={icon}>{message}</Icon>
39
+ {#if actionText}
40
+ <Button {color} variant="fill" on:click={respond}>
41
+ {actionText}
42
+ </Button>
43
+ {/if}
44
+ </Notification>
@@ -0,0 +1,36 @@
1
+ # Toast
2
+
3
+ Displays toast notifications along the edge of the screen.
4
+
5
+ ## Props
6
+ See the Toaster component. The Toast component is wrapper around it that
7
+ also controls the children being shown for convenience.
8
+
9
+ - ### component
10
+ The component to use as a wrapper for the messages. Defaults to the
11
+ ToastMessage component.
12
+
13
+ ## Functions
14
+ - ### show(duration, props)
15
+ Shows a toast notification that will disappear after the specified
16
+ duration (time in milliseconds). The props provided are passed to an
17
+ instance of the component specified in the props.
18
+
19
+ ## Events
20
+ - ### action(info)
21
+ Fired when a toast message is clicked. The info argument contains a
22
+ value property that is provided by the message component, and a copy
23
+ of the props passed to that instace.\\
24
+ For the default messages, the value will be `null` if no button was
25
+ clicked, and `true` if the action button was clicked. This allows
26
+ actions to be taken against interactions in the message without having
27
+ to bind all kinds of events or callbacks.
28
+
29
+ ## Usage
30
+ ```js
31
+ let toast = null
32
+ const notify = () => toast.show(5000, { message: "hi" })
33
+ ```
34
+ ```svelte
35
+ <Toast bind:this={toast} position="bc" />
36
+ ```
@@ -1,108 +1,68 @@
1
- <script context="module">
2
- const genID = () => `${Date.now()}:${Math.random().toString(16)}`
3
-
4
- const delays = {}
5
- const delay = ({time, action, id}) => {
6
- const trigger = () => {
7
- const info = delays[id]
8
- clearTimeout(info.id)
9
- action()
10
- delete delays[id]
11
- }
12
- const timeoutID = setTimeout(trigger, time)
13
- delays[id] = { trigger, id: timeoutID }
14
- }
15
- delay.trigger = (id) => delays[id].trigger()
16
- </script>
17
-
18
- <script>
19
- /*md
20
- [@] Components/Toast
21
-
22
- # Toast
23
-
24
- Displays toast notifications along the edge of the screen.
25
-
26
- ## Props
27
- See the Toaster component. The Toast component is wrapper around it that
28
- also controls the children being shown for convenience.
29
-
30
- - ### component
31
- The component to use as a wrapper for the messages. Defaults to the
32
- ToastMessage component.
33
-
34
- ## Functions
35
- - ### show(duration, props)
36
- Shows a toast notification that will disappear after the specified
37
- duration (time in milliseconds). The props provided are passed to an
38
- instance of the component specified in the props.
39
-
40
- ## Events
41
- - ### action(info)
42
- Fired when a toast message is clicked. The info argument contains a
43
- value property that is provided by the message component, and a copy
44
- of the props passed to that instace.\\
45
- For the default messages, the value will be `null` if no button was
46
- clicked, and `true` if the action button was clicked. This allows
47
- actions to be taken against interactions in the message without having
48
- to bind all kinds of events or callbacks.
49
-
50
- ## Usage
51
- ```js
52
- let toast = null
53
- const notify = () => toast.show(5000, { message: "hi" })
54
- ```
55
- ```svelte
56
- <Toast bind:this={toast} position="bc" />
57
- ```
58
- */
59
- import { createEventDispatcher } from "svelte"
60
- import { fade } from "svelte/transition"
61
-
62
- import { eventHandler$ } from "../handler$.mjs"
63
-
64
- import Toaster from "../toaster.svelte"
65
-
66
- import ToastMessage from "./toast/message.svelte"
67
-
68
- export let component = ToastMessage
69
- export let position = "tc"
70
-
71
- let items = []
72
-
73
- const dispatch = createEventDispatcher()
74
- const act = eventHandler$(
75
- (evt, id, props) => {
76
- delay.trigger(id)
77
- dispatch(
78
- "action",
79
- { value: evt.detail, props }
80
- )
81
- }
82
- )
83
-
84
- export const show = (duration, props) => {
85
- const id = genID()
86
- items = [...items, { id, props }]
87
- delay({
88
- action: () => items = items.filter(
89
- item => item.id !== id
90
- ),
91
- time: duration,
92
- id,
93
- })
94
- }
95
- export const clear = () => items = []
96
- </script>
97
-
98
- <Toaster {position} {...$$restProps}>
99
- {#each items as {props, id} (id)}
100
- <wsv-toast-wrapper ws-x="grid" transition:fade={{duration: 200}}>
101
- <svelte:component
102
- this={component}
103
- {...props}
104
- on:action={act(id, props)}
105
- />
106
- </wsv-toast-wrapper>
107
- {/each}
108
- </Toaster>
1
+ <script context="module">
2
+ const genID = () => `${Date.now()}:${Math.random().toString(16)}`
3
+
4
+ const delays = {}
5
+ const delay = ({time, action, id}) => {
6
+ const trigger = () => {
7
+ const info = delays[id]
8
+ clearTimeout(info.id)
9
+ action()
10
+ delete delays[id]
11
+ }
12
+ const timeoutID = setTimeout(trigger, time)
13
+ delays[id] = { trigger, id: timeoutID }
14
+ }
15
+ delay.trigger = (id) => delays[id].trigger()
16
+ </script>
17
+
18
+ <script>
19
+ import { createEventDispatcher } from "svelte"
20
+ import { fade } from "svelte/transition"
21
+
22
+ import { eventHandler$ } from "../handler$.mjs"
23
+
24
+ import Toaster from "../info/toaster.svelte"
25
+
26
+ import ToastMessage from "./toast/message.svelte"
27
+
28
+ export let component = ToastMessage
29
+ export let position = "tc"
30
+
31
+ let items = []
32
+
33
+ const dispatch = createEventDispatcher()
34
+ const act = eventHandler$(
35
+ (evt, id, props) => {
36
+ delay.trigger(id)
37
+ dispatch(
38
+ "action",
39
+ { value: evt.detail, props }
40
+ )
41
+ }
42
+ )
43
+
44
+ export const show = (duration, props) => {
45
+ const id = genID()
46
+ items = [...items, { id, props }]
47
+ delay({
48
+ action: () => items = items.filter(
49
+ item => item.id !== id
50
+ ),
51
+ time: duration,
52
+ id,
53
+ })
54
+ }
55
+ export const clear = () => items = []
56
+ </script>
57
+
58
+ <Toaster {position} {...$$restProps}>
59
+ {#each items as {props, id} (id)}
60
+ <zephyr-toast-wrapper ws-x="grid" transition:fade={{duration: 200}}>
61
+ <svelte:component
62
+ this={component}
63
+ {...props}
64
+ on:action={act(id, props)}
65
+ />
66
+ </zephyr-toast-wrapper>
67
+ {/each}
68
+ </Toaster>
@@ -0,0 +1,37 @@
1
+ # Button
2
+
3
+ Basic clickable component for handling user interaction.
4
+
5
+ ## Props
6
+
7
+ ### color
8
+ `string`
9
+
10
+ Sets `$color`
11
+
12
+ ### compact
13
+ `bool`
14
+
15
+ Sets `$compact`
16
+
17
+ ### fill / outline
18
+ `bool`
19
+
20
+ Sets the button type to $fill if fill is true, $outline if outline
21
+ is true, or $flat if neither is true.
22
+
23
+ ## Events
24
+ - click
25
+
26
+ ## Example
27
+ ```svelte
28
+ <Button on:click={action}>
29
+ Flat Button
30
+ </Button>
31
+ <Button on:click={action} outline>
32
+ Outlined Button
33
+ </Button>
34
+ <Button on:click={action} fill color="danger">
35
+ Filled Button
36
+ </Button>
37
+ ```
@@ -0,0 +1,25 @@
1
+ <script>
2
+ import wsx from "../wsx.mjs"
3
+ import variant from "../variant.mjs"
4
+
5
+ export let color = false
6
+ export let compact = false
7
+ export let disabled
8
+
9
+ export let fill = false
10
+ export let outline = false
11
+ export let flat = false
12
+
13
+ $: type = variant({ fill, outline, flat })
14
+
15
+ $: wind = {
16
+ [type]: true,
17
+ "$color": color,
18
+ $compact: compact,
19
+ ...$$restProps
20
+ }
21
+ </script>
22
+
23
+ <button use:wsx={wind} {disabled} on:click|stopPropagation>
24
+ <slot />
25
+ </button>
@@ -0,0 +1,107 @@
1
+ <script context="module">
2
+ const parseNumeric = (value) => {
3
+ if (value === "") {
4
+ return null
5
+ }
6
+ return parseFloat(value)
7
+ }
8
+
9
+ const diff = (type, value, internal) => {
10
+ if ((type !== "number" && type !== "range") || typeof value === "string") {
11
+ return value !== internal
12
+ }
13
+ return parseFloat(internal) !== value
14
+ }
15
+ </script>
16
+
17
+ <script>
18
+ import wsx from "../wsx.mjs"
19
+
20
+ export let type = "text"
21
+
22
+ export let flat = false
23
+ export let label
24
+ export let color = "default"
25
+ export let error = null
26
+ export let hint = null
27
+ export let disabled
28
+
29
+ export let value = ""
30
+ export let autocompleteOptions = null
31
+
32
+ export let transform = i => i
33
+ export let tvalue
34
+ export let validate = () => true
35
+ export let valid
36
+
37
+ let input = null
38
+ let internalValue = value
39
+ export const focus = () => input.focus()
40
+
41
+ const id =
42
+ (autocompleteOptions === null)
43
+ ? null
44
+ : `${Math.random().toString(16)}_${Date.now()}`
45
+
46
+ $: isNumeric = (type === "number" || type === "range")
47
+ $: if (diff(type, value, internalValue) === true) {
48
+ internalValue = value
49
+ }
50
+
51
+ const update = (evt) => {
52
+ internalValue = evt.target.value
53
+ value = (isNumeric === true) ? parseNumeric(internalValue) : internalValue
54
+ tvalue = transform(value)
55
+ valid = validate(tvalue)
56
+ }
57
+
58
+ $: restKeys = Object.keys($$restProps)
59
+ $: props = restKeys.reduce(
60
+ (props, key) => {
61
+ const [target, name] =
62
+ (key.startsWith("i-") === true)
63
+ ? [props.input, key.slice(2)]
64
+ : [props.wind, key]
65
+ target[name] = $$restProps[key]
66
+ return props
67
+ },
68
+ {wind: {}, input: {}}
69
+ )
70
+
71
+ $: wind = {
72
+ "$flat": flat,
73
+ "$control": true,
74
+ "$color": color,
75
+ ...props.wind,
76
+ }
77
+
78
+ $: tag = (type === "area") ? "textarea" : "input"
79
+ </script>
80
+
81
+ <label use:wsx={wind} ws-error={error}>
82
+ {#if label}
83
+ <span ws-x="$text" ws-hint={hint}>{label}</span>
84
+ {/if}
85
+ <svelte:element
86
+ this={tag}
87
+ {...props.input}
88
+ {disabled}
89
+ {type}
90
+ value={internalValue}
91
+ list={id}
92
+ on:focus
93
+ on:blur
94
+ on:input={update}
95
+ bind:this={input}
96
+ />
97
+
98
+ <slot name="start" />
99
+ <slot name="end" />
100
+ {#if autocompleteOptions !== null}
101
+ <datalist {id}>
102
+ {#each autocompleteOptions as value}
103
+ <option {value} />
104
+ {/each}
105
+ </datalist>
106
+ {/if}
107
+ </label>
File without changes
@@ -0,0 +1,36 @@
1
+ <script>
2
+ import wsx from "../wsx.mjs"
3
+ import variant from "../variant.mjs"
4
+
5
+ export let color = false
6
+ export let compact = false
7
+ export let disabled
8
+
9
+ export let fill = false
10
+ export let outline = false
11
+ export let flat = false
12
+
13
+ let _for = ""
14
+ export { _for as for }
15
+ export let button = false
16
+
17
+ $: type = variant({ fill, outline, flat })
18
+ $: baseStyles =
19
+ (button === true)
20
+ ? {
21
+ $button: true,
22
+ [type]: true,
23
+ "$color": color,
24
+ $compact: compact,
25
+ }
26
+ : {}
27
+
28
+ $: wind = {
29
+ ...baseStyles,
30
+ ...$$restProps
31
+ }
32
+ </script>
33
+
34
+ <label use:wsx={wind} {disabled} for={_for}>
35
+ <slot />
36
+ </label>