lapikit 0.0.0-insiders.e330f8d → 0.0.0-insiders.e82bc5b

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 (114) hide show
  1. package/dist/actions/index.d.ts +1 -0
  2. package/dist/actions/index.js +1 -0
  3. package/dist/assets/icons/arrow-down.svelte +10 -0
  4. package/dist/assets/icons/arrow-down.svelte.d.ts +26 -0
  5. package/dist/assets/icons/arrow-up.svelte +10 -0
  6. package/dist/assets/icons/arrow-up.svelte.d.ts +26 -0
  7. package/dist/assets/icons/close-fill.svelte +10 -0
  8. package/dist/assets/icons/close-fill.svelte.d.ts +26 -0
  9. package/dist/assets/icons/loading-fill.svelte +29 -0
  10. package/dist/assets/icons/loading-fill.svelte.d.ts +26 -0
  11. package/dist/components/accordion/accordion.css +113 -0
  12. package/dist/components/accordion/accordion.svelte +37 -0
  13. package/dist/components/accordion/accordion.svelte.d.ts +4 -0
  14. package/dist/components/accordion/accordion.svelte.js +24 -0
  15. package/dist/components/accordion/modules/accordion-item.svelte +94 -0
  16. package/dist/components/accordion/modules/accordion-item.svelte.d.ts +4 -0
  17. package/dist/components/accordion/types.d.ts +33 -0
  18. package/dist/components/accordion/types.js +1 -0
  19. package/dist/components/alert/alert.css +127 -0
  20. package/dist/components/alert/alert.svelte +89 -0
  21. package/dist/components/alert/alert.svelte.d.ts +4 -0
  22. package/dist/components/alert/types.d.ts +28 -0
  23. package/dist/components/alert/types.js +1 -0
  24. package/dist/components/app/app.css +16 -0
  25. package/dist/components/app/app.svelte +12 -1
  26. package/dist/components/aspect-ratio/aspect-ratio.css +19 -0
  27. package/dist/components/aspect-ratio/aspect-ratio.svelte +48 -0
  28. package/dist/components/aspect-ratio/aspect-ratio.svelte.d.ts +4 -0
  29. package/dist/components/aspect-ratio/types.d.ts +5 -0
  30. package/dist/components/aspect-ratio/types.js +1 -0
  31. package/dist/components/avatar/avatar.css +109 -0
  32. package/dist/components/avatar/avatar.svelte +46 -0
  33. package/dist/components/avatar/avatar.svelte.d.ts +4 -0
  34. package/dist/components/avatar/types.d.ts +22 -0
  35. package/dist/components/avatar/types.js +1 -0
  36. package/dist/components/button/button.css +47 -11
  37. package/dist/components/button/button.svelte +14 -1
  38. package/dist/components/button/types.d.ts +3 -0
  39. package/dist/components/card/card.css +109 -0
  40. package/dist/components/card/card.svelte +50 -0
  41. package/dist/components/card/card.svelte.d.ts +4 -0
  42. package/dist/components/card/types.d.ts +18 -0
  43. package/dist/components/card/types.js +1 -0
  44. package/dist/components/chip/chip.css +199 -0
  45. package/dist/components/chip/chip.svelte +118 -0
  46. package/dist/components/chip/chip.svelte.d.ts +4 -0
  47. package/dist/components/chip/types.d.ts +30 -0
  48. package/dist/components/chip/types.js +1 -0
  49. package/dist/components/dialog/dialog.css +134 -0
  50. package/dist/components/dialog/dialog.svelte +67 -0
  51. package/dist/components/dialog/dialog.svelte.d.ts +4 -0
  52. package/dist/components/dialog/types.d.ts +24 -0
  53. package/dist/components/dialog/types.js +1 -0
  54. package/dist/components/dropdown/dropdown.css +22 -0
  55. package/dist/components/dropdown/dropdown.svelte +116 -0
  56. package/dist/components/dropdown/dropdown.svelte.d.ts +4 -0
  57. package/dist/components/dropdown/dropdown.svelte.js +148 -0
  58. package/dist/components/dropdown/types.d.ts +26 -0
  59. package/dist/components/dropdown/types.js +1 -0
  60. package/dist/components/icon/icon.css +76 -0
  61. package/dist/components/icon/icon.svelte +49 -0
  62. package/dist/components/icon/icon.svelte.d.ts +4 -0
  63. package/dist/components/icon/types.d.ts +16 -0
  64. package/dist/components/icon/types.js +1 -0
  65. package/dist/components/index.d.ts +17 -0
  66. package/dist/components/index.js +17 -0
  67. package/dist/components/list/list.css +195 -0
  68. package/dist/components/list/list.svelte +46 -0
  69. package/dist/components/list/list.svelte.d.ts +4 -0
  70. package/dist/components/list/modules/list-item.svelte +68 -0
  71. package/dist/components/list/modules/list-item.svelte.d.ts +4 -0
  72. package/dist/components/list/types.d.ts +36 -0
  73. package/dist/components/list/types.js +1 -0
  74. package/dist/components/modal/modal.css +140 -0
  75. package/dist/components/modal/modal.svelte +112 -0
  76. package/dist/components/modal/modal.svelte.d.ts +4 -0
  77. package/dist/components/modal/types.d.ts +26 -0
  78. package/dist/components/modal/types.js +1 -0
  79. package/dist/components/popover/popover.css +22 -0
  80. package/dist/components/popover/popover.svelte +73 -0
  81. package/dist/components/popover/popover.svelte.d.ts +4 -0
  82. package/dist/components/popover/popover.svelte.js +134 -0
  83. package/dist/components/popover/types.d.ts +20 -0
  84. package/dist/components/popover/types.js +1 -0
  85. package/dist/components/separator/separator.css +46 -0
  86. package/dist/components/separator/separator.svelte +37 -0
  87. package/dist/components/separator/separator.svelte.d.ts +4 -0
  88. package/dist/components/separator/types.d.ts +11 -0
  89. package/dist/components/separator/types.js +1 -0
  90. package/dist/components/toolbar/toolbar.css +142 -0
  91. package/dist/components/toolbar/toolbar.svelte +47 -0
  92. package/dist/components/toolbar/toolbar.svelte.d.ts +4 -0
  93. package/dist/components/toolbar/types.d.ts +27 -0
  94. package/dist/components/toolbar/types.js +1 -0
  95. package/dist/components/tooltip/tooltip.css +124 -0
  96. package/dist/components/tooltip/tooltip.svelte +113 -0
  97. package/dist/components/tooltip/tooltip.svelte.d.ts +4 -0
  98. package/dist/components/tooltip/tooltip.svelte.js +131 -0
  99. package/dist/components/tooltip/types.d.ts +23 -0
  100. package/dist/components/tooltip/types.js +1 -0
  101. package/dist/internal/assets.svelte.d.ts +1 -0
  102. package/dist/internal/assets.svelte.js +11 -0
  103. package/dist/internal/clickOutside.d.ts +9 -0
  104. package/dist/internal/clickOutside.js +34 -0
  105. package/dist/internal/index.d.ts +1 -0
  106. package/dist/internal/index.js +1 -0
  107. package/dist/internal/scroll.d.ts +1 -0
  108. package/dist/internal/scroll.js +6 -0
  109. package/dist/stores/index.d.ts +5 -0
  110. package/dist/stores/index.js +21 -2
  111. package/dist/style/animation.css +9 -0
  112. package/dist/style/css.js +3 -0
  113. package/dist/style/variable.css +12 -0
  114. package/package.json +6 -2
@@ -0,0 +1,73 @@
1
+ <script lang="ts">
2
+ import { getAssets } from '../../internal/assets.svelte.js';
3
+ import { clickOutside } from '../../internal/clickOutside.js';
4
+ import { getPositions } from './popover.svelte.js';
5
+ import type { PopoverProps, ModelPopoverProps } from './types.js';
6
+
7
+ let {
8
+ open = $bindable(),
9
+ children,
10
+ activator,
11
+ dark,
12
+ light,
13
+ rounded,
14
+ position,
15
+ color,
16
+ background,
17
+ ...rest
18
+ }: PopoverProps = $props();
19
+
20
+ const positionAxis = getPositions();
21
+ const assets = getAssets();
22
+
23
+ let ref: HTMLElement | null = $state(null);
24
+ let refActivator: HTMLElement | null = $state(null);
25
+ let axis = $state({ x: 0, y: 0 });
26
+ let innerHeight = $state(0);
27
+ let innerWidth = $state(0);
28
+ let scrollX = $state(0);
29
+ let scrollY = $state(0);
30
+
31
+ axis = positionAxis?.values;
32
+
33
+ let model: ModelPopoverProps = {
34
+ toggle: (element) => handleToggle(element)
35
+ };
36
+
37
+ const handleToggle = (element: HTMLElement | null) => {
38
+ if (element === null) return;
39
+ refActivator = element;
40
+ open = !open;
41
+ };
42
+
43
+ $effect(() => {
44
+ if (
45
+ open &&
46
+ ref &&
47
+ refActivator &&
48
+ (scrollX > 0 || scrollY > 0 || innerHeight > 0 || innerWidth > 0)
49
+ ) {
50
+ positionAxis.update(refActivator, ref, position);
51
+ }
52
+ });
53
+ </script>
54
+
55
+ <svelte:window bind:innerHeight bind:innerWidth bind:scrollX bind:scrollY />
56
+
57
+ {@render activator?.(model)}
58
+
59
+ {#if open}
60
+ <div
61
+ bind:this={ref}
62
+ {...rest}
63
+ role="menu"
64
+ class={['kit-popover-content', light && 'light', dark && 'dark', rest.class]}
65
+ style={`transform: translate(${axis.x}px, ${axis.y}px);`}
66
+ style:--base={assets.color(background)}
67
+ style:--on={assets.color(color)}
68
+ style:--shape={assets.shape(rounded)}
69
+ use:clickOutside={{ exclude: [ref, refActivator], onClose: () => (open = false) }}
70
+ >
71
+ {@render children?.()}
72
+ </div>
73
+ {/if}
@@ -0,0 +1,4 @@
1
+ import type { PopoverProps } from './types.js';
2
+ declare const Popover: import("svelte").Component<PopoverProps, {}, "open">;
3
+ type Popover = ReturnType<typeof Popover>;
4
+ export default Popover;
@@ -0,0 +1,134 @@
1
+ import { innerWidth, innerHeight } from 'svelte/reactivity/window';
2
+ export function getPositions() {
3
+ // state
4
+ const axis = $state({
5
+ x: 0,
6
+ y: 0,
7
+ location: null
8
+ });
9
+ return {
10
+ get values() {
11
+ return axis;
12
+ },
13
+ update(activator, element, location, centered, avoidCollisions) {
14
+ if (!activator || !element)
15
+ return;
16
+ const elementRect = element.getBoundingClientRect();
17
+ if (activator instanceof HTMLElement) {
18
+ const activatorRect = activator.getBoundingClientRect();
19
+ const spacing = 6;
20
+ const _activator = activatorRect.y + activatorRect.height;
21
+ const _element = elementRect.height + spacing;
22
+ if (location === 'top' || location === 'bottom') {
23
+ if (avoidCollisions) {
24
+ if (location === 'top') {
25
+ if (activatorRect.y - _element < 0) {
26
+ axis.y = activatorRect.bottom + spacing;
27
+ axis.location = 'bottom';
28
+ }
29
+ else {
30
+ axis.y = activatorRect.top - _element;
31
+ axis.location = 'top';
32
+ }
33
+ }
34
+ else {
35
+ if (_activator + _element > innerHeight.current) {
36
+ axis.y = activatorRect.top - _element;
37
+ axis.location = 'top';
38
+ }
39
+ else {
40
+ axis.y = activatorRect.bottom + spacing;
41
+ axis.location = 'bottom';
42
+ }
43
+ }
44
+ }
45
+ else {
46
+ if (location === 'top') {
47
+ axis.y = activatorRect.top - _element;
48
+ axis.location = 'top';
49
+ }
50
+ else {
51
+ axis.y = activatorRect.bottom + spacing;
52
+ axis.location = 'bottom';
53
+ }
54
+ }
55
+ if (centered &&
56
+ activatorRect.left - (elementRect.width - activatorRect.width) / 2 > 0 &&
57
+ activatorRect.left + elementRect.width < innerWidth.current) {
58
+ axis.x = activatorRect.left - (elementRect.width - activatorRect.width) / 2;
59
+ }
60
+ else if (activatorRect.left + elementRect.width > innerWidth.current) {
61
+ axis.x = activatorRect.left - (elementRect.width - activatorRect.width);
62
+ }
63
+ else {
64
+ axis.x = activatorRect.left;
65
+ }
66
+ }
67
+ else if (location === 'left' || location === 'right') {
68
+ if (avoidCollisions) {
69
+ if (location === 'left' && !(activatorRect.left - elementRect.width < 0)) {
70
+ axis.x = activatorRect.left - (elementRect.width + spacing);
71
+ axis.location = 'left';
72
+ }
73
+ else {
74
+ if (activatorRect.left + activatorRect.width + elementRect.width + spacing >
75
+ innerWidth.current) {
76
+ axis.x = activatorRect.left - (elementRect.width + spacing);
77
+ axis.location = 'left';
78
+ }
79
+ else {
80
+ axis.x = activatorRect.left + activatorRect.width + spacing;
81
+ axis.location = 'right';
82
+ }
83
+ }
84
+ }
85
+ else {
86
+ if (location === 'left') {
87
+ axis.x = activatorRect.left - (elementRect.width + spacing);
88
+ axis.location = 'left';
89
+ }
90
+ else {
91
+ axis.x = activatorRect.left + activatorRect.width + spacing;
92
+ axis.location = 'right';
93
+ }
94
+ }
95
+ if (centered &&
96
+ activatorRect.top - (elementRect.height - activatorRect.height) / 2 > 0 &&
97
+ activatorRect.top + elementRect.height < innerHeight.current) {
98
+ axis.y = activatorRect.top - (elementRect.height - activatorRect.height) / 2;
99
+ }
100
+ else if (activatorRect.y + elementRect.height > innerHeight.current) {
101
+ axis.y = activatorRect.y - elementRect.height + activatorRect.height;
102
+ }
103
+ else {
104
+ axis.y = activatorRect.y;
105
+ }
106
+ }
107
+ else {
108
+ if (centered &&
109
+ activatorRect.left - (elementRect.width - activatorRect.width) / 2 > 0 &&
110
+ activatorRect.left + elementRect.width < innerWidth.current) {
111
+ axis.x = activatorRect.left - (elementRect.width - activatorRect.width) / 2;
112
+ }
113
+ else if (activatorRect.left + elementRect.width > innerWidth.current) {
114
+ axis.x = activatorRect.left - (elementRect.width - activatorRect.width);
115
+ }
116
+ else {
117
+ axis.x = activatorRect.left;
118
+ }
119
+ if (centered &&
120
+ activatorRect.top - (elementRect.height - activatorRect.height) / 2 > 0 &&
121
+ activatorRect.top + elementRect.height < innerHeight.current) {
122
+ axis.y = activatorRect.top - (elementRect.height - activatorRect.height) / 2;
123
+ }
124
+ else if (activatorRect.bottom + elementRect.height > innerHeight.current) {
125
+ axis.y = activatorRect.top - elementRect.height;
126
+ }
127
+ else {
128
+ axis.y = activatorRect.bottom;
129
+ }
130
+ }
131
+ }
132
+ }
133
+ };
134
+ }
@@ -0,0 +1,20 @@
1
+ import type { Component } from '../../internal/types.js';
2
+ import type { Snippet } from 'svelte';
3
+ export type PositionElement = {
4
+ x: number;
5
+ y: number;
6
+ location: string | null;
7
+ };
8
+ export interface PopoverProps extends Component {
9
+ open?: boolean;
10
+ dark?: boolean;
11
+ light?: boolean;
12
+ rounded?: string;
13
+ position?: 'top' | 'bottom' | 'left' | 'right';
14
+ color?: string;
15
+ background?: string;
16
+ activator?: Snippet<[ModelPopoverProps]>;
17
+ }
18
+ export type ModelPopoverProps = {
19
+ toggle: (element: HTMLElement | null) => void;
20
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,46 @@
1
+ .kit-separator {
2
+ --separator-opacity: var(--opacity, 0.12);
3
+ --separator-color: var(--base, var(--kit-scrim));
4
+
5
+ display: block;
6
+ flex: 1 1 100%;
7
+ height: 0px;
8
+ max-height: 0px;
9
+ opacity: var(--separator-opacity);
10
+ transition: inherit;
11
+ border-color: var(--separator-color);
12
+ transition: border-color 0.5s;
13
+ border-style: solid;
14
+ }
15
+
16
+ .kit-separator:not(.kit-separator--orientation-vertical) {
17
+ border-width: var(--border-top-width, thin) 0 0 0;
18
+ }
19
+
20
+ .kit-separator--orientation-vertical {
21
+ align-self: stretch;
22
+ border-width: 0 thin 0 0;
23
+ display: inline-flex;
24
+ height: auto;
25
+ margin-left: 0px;
26
+ max-height: 100%;
27
+ max-width: 0px;
28
+ vertical-align: text-bottom;
29
+ width: 0px;
30
+ border-width: 0 var(--border-right-width, thin) 0 0;
31
+ }
32
+
33
+ .kit-separator--inset:not(.kit-separator--orientation-vertical) {
34
+ max-width: calc(100% - 4.5rem);
35
+ margin-inline-start: 4.5rem;
36
+ }
37
+
38
+ .kit-separator--inset.kit-separator--orientation-vertical {
39
+ margin-bottom: 0.5rem;
40
+ margin-top: 0.5rem;
41
+ max-height: calc(100% - 1rem);
42
+ }
43
+
44
+ .kit-separator:not(.kit-separator--orientation-vertical) {
45
+ width: 100%;
46
+ }
@@ -0,0 +1,37 @@
1
+ <script lang="ts">
2
+ import { getAssets } from '../../internal/index.js';
3
+ import type { SeparatorProps } from './types.js';
4
+
5
+ let {
6
+ is = 'hr',
7
+ light,
8
+ dark,
9
+ inset,
10
+ thickness,
11
+ orientation = 'horizontal',
12
+ opacity,
13
+ color,
14
+ ...rest
15
+ }: SeparatorProps = $props();
16
+
17
+ const assets = getAssets();
18
+ </script>
19
+
20
+ <svelte:element
21
+ this={is}
22
+ {...rest}
23
+ class={[
24
+ 'kit-separator',
25
+ light && 'light',
26
+ dark && 'dark',
27
+ inset && 'kit-separator--inset',
28
+ orientation && assets.className('separator', 'orientation', orientation),
29
+ rest.class
30
+ ]}
31
+ aria-orientation={orientation}
32
+ role="separator"
33
+ style:--base={assets.color(color)}
34
+ style:--opacity={opacity}
35
+ style:--border-top-width={orientation === 'horizontal' ? assets.unit(thickness) : undefined}
36
+ style:--border-right-width={orientation === 'vertical' ? assets.unit(thickness) : undefined}
37
+ />
@@ -0,0 +1,4 @@
1
+ import type { SeparatorProps } from './types.js';
2
+ declare const Separator: import("svelte").Component<SeparatorProps, {}, "">;
3
+ type Separator = ReturnType<typeof Separator>;
4
+ export default Separator;
@@ -0,0 +1,11 @@
1
+ import type { Base } from '../../internal/types.js';
2
+ export interface SeparatorProps extends Base {
3
+ is?: 'div' | 'hr';
4
+ light?: boolean;
5
+ dark?: boolean;
6
+ inset?: boolean;
7
+ thickness?: string;
8
+ opacity?: string | number;
9
+ color?: string;
10
+ orientation?: 'horizontal' | 'vertical';
11
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,142 @@
1
+ .kit-toolbar {
2
+ --toolbar-color: var(--on, var(--kit-on-neutral));
3
+ --toolbar-background: var(--base, var(--kit-neutral));
4
+ --toolbar-radius: var(--shape, var(--kit-radius-md));
5
+
6
+ display: flex;
7
+ align-items: center;
8
+ min-width: max-content;
9
+ border-style: solid;
10
+ transition:
11
+ color 0.5s,
12
+ border-color 0.5s,
13
+ background-color 0.5s;
14
+
15
+ border-width: 1px;
16
+ border-style: solid;
17
+ border-radius: var(--toolbar-radius);
18
+
19
+ /* theme */
20
+ color: var(--toolbar-color);
21
+ background-color: var(--toolbar-background);
22
+ border-color: var(--toolbar-background);
23
+ }
24
+
25
+ /* density */
26
+ .kit-card[breakpoint]kit-card--density-default {
27
+ --card-spacing-x: 0.25rem;
28
+ --card-spacing-y: 0.25rem;
29
+ }
30
+
31
+ .kit-card[breakpoint]kit-card--density-compact {
32
+ --card-spacing-x: 0;
33
+ --card-spacing-y: 0;
34
+ }
35
+
36
+ .kit-card[breakpoint]kit-card--density-comfortable {
37
+ --card-spacing-x: 0.5rem;
38
+ --card-spacing-y: 0.5rem;
39
+ }
40
+
41
+ /* density */
42
+ .kit-toolbar[breakpoint]kit-toolbar--density-default {
43
+ border-radius: calc(var(--kit-spacing) * 2.25);
44
+ }
45
+ .kit-toolbar[breakpoint]kit-toolbar--density-default:not([class*='toolbar--orientation-vertical']) {
46
+ height: 3rem;
47
+ padding-inline: calc(var(--kit-spacing) * 1.5);
48
+ }
49
+
50
+ .kit-toolbar[breakpoint]kit-toolbar--density-default[class*='toolbar--orientation-vertical'] {
51
+ width: 3rem;
52
+ padding: calc(var(--kit-spacing) * 1.5) 0;
53
+ }
54
+
55
+ .kit-toolbar[breakpoint]kit-toolbar--density-compact {
56
+ border-radius: calc(var(--kit-spacing) * 1.75);
57
+ }
58
+
59
+ .kit-toolbar[breakpoint]kit-toolbar--density-compact:not([class*='toolbar--orientation-vertical']) {
60
+ height: 2.625rem;
61
+ padding-inline: calc(var(--kit-spacing) * 0.75);
62
+ }
63
+
64
+ .kit-toolbar[breakpoint]kit-toolbar--density-compact[class*='toolbar--orientation-vertical'] {
65
+ width: 2.625rem;
66
+ padding: calc(var(--kit-spacing) * 0.75) 0;
67
+ }
68
+
69
+ .kit-toolbar[breakpoint]kit-toolbar--density-comfortable {
70
+ border-radius: calc(var(--kit-spacing) * 3.5);
71
+ }
72
+
73
+ .kit-toolbar[breakpoint]kit-toolbar--density-comfortable:not(
74
+ [class*='toolbar--orientation-vertical']
75
+ ) {
76
+ height: 3.5rem;
77
+ padding-inline: calc(var(--kit-spacing) * 2.25);
78
+ }
79
+
80
+ .kit-toolbar[breakpoint]kit-toolbar--density-comfortable[class*='toolbar--orientation-vertical'] {
81
+ width: 3.5rem;
82
+ padding: calc(var(--kit-spacing) * 2.25) 0;
83
+ }
84
+
85
+ .kit-toolbar[breakpoint]kit-toolbar--variant-text,
86
+ .kit-toolbar[breakpoint]kit-toolbar--variant-outline,
87
+ .kit-toolbar[breakpoint]kit-toolbar--variant-dash {
88
+ --toolbar-color: var(--base, var(--kit-neutral));
89
+ background-color: transparent;
90
+ }
91
+
92
+ .kit-toolbar[breakpoint]kit-toolbar--variant-outline {
93
+ border-color: currentColor;
94
+ }
95
+
96
+ .kit-toolbar[breakpoint]kit-toolbar--variant-dash {
97
+ border-style: dashed;
98
+ border-color: currentColor;
99
+ }
100
+
101
+ .kit-toolbar[breakpoint]kit-toolbar--orientation-horizontal {
102
+ flex-direction: row;
103
+ }
104
+
105
+ .kit-toolbar[breakpoint]kit-toolbar--orientation-vertical {
106
+ flex-direction: column;
107
+ min-height: fit-content;
108
+ }
109
+
110
+ /* wrapper */
111
+ .kit-toolbar .kit-toolbar--wrapper {
112
+ display: flex;
113
+ align-items: center;
114
+ /* margin-left: auto;
115
+ margin-right: auto; */
116
+ flex-direction: row;
117
+ height: auto;
118
+ }
119
+
120
+ .kit-toolbar[breakpoint]kit-toolbar--orientation-vertical .kit-toolbar--wrapper {
121
+ flex-direction: column;
122
+ height: 100%;
123
+ }
124
+
125
+ /* location */
126
+ .kit-toolbar[breakpoint]kit-toolbar--location-top {
127
+ top: 0px;
128
+ z-index: 1004;
129
+ transform: translateY(0px);
130
+ position: fixed;
131
+ left: 0px;
132
+ width: calc(100% + 0px);
133
+ }
134
+
135
+ .kit-toolbar[breakpoint]kit-toolbar--location-bottom {
136
+ z-index: 1004;
137
+ transform: translateY(0px);
138
+ position: fixed;
139
+ left: 0px;
140
+ width: calc(100% + 0px);
141
+ bottom: 0px;
142
+ }
@@ -0,0 +1,47 @@
1
+ <script lang="ts">
2
+ import { getAssets } from '../../internal/index.js';
3
+ import type { ToolbarProps } from './types.js';
4
+
5
+ let {
6
+ children,
7
+ ref = $bindable(),
8
+ is = 'div',
9
+ classContent,
10
+ light,
11
+ dark,
12
+ variant,
13
+ rounded,
14
+ background,
15
+ color,
16
+ density = 'default',
17
+ orientation = 'horizontal',
18
+ location,
19
+ ...rest
20
+ }: ToolbarProps = $props();
21
+
22
+ const assets = getAssets();
23
+ </script>
24
+
25
+ <svelte:element
26
+ this={is}
27
+ bind:this={ref}
28
+ {...rest}
29
+ role="toolbar"
30
+ class={[
31
+ 'kit-toolbar',
32
+ light && 'light',
33
+ dark && 'dark',
34
+ variant && assets.className('toolbar', 'variant', variant),
35
+ density && assets.className('toolbar', 'density', density),
36
+ orientation && assets.className('toolbar', 'orientation', orientation),
37
+ location && assets.className('toolbar', 'location', location),
38
+ rest.class
39
+ ]}
40
+ style:--base={assets.color(background)}
41
+ style:--on={assets.color(color)}
42
+ style:--shape={assets.shape(rounded)}
43
+ >
44
+ <div class={['kit-toolbar--wrapper', classContent]}>
45
+ {@render children?.()}
46
+ </div>
47
+ </svelte:element>
@@ -0,0 +1,4 @@
1
+ import type { ToolbarProps } from './types.js';
2
+ declare const Toolbar: import("svelte").Component<ToolbarProps, {}, "ref">;
3
+ type Toolbar = ReturnType<typeof Toolbar>;
4
+ export default Toolbar;
@@ -0,0 +1,27 @@
1
+ import type { Component } from '../../internal/types.js';
2
+ type Variant = 'outline' | 'text' | 'dash';
3
+ type Density = 'compact' | 'comfortable' | 'default';
4
+ type Orientation = 'horizontal' | 'vertical';
5
+ type Location = 'top' | 'bottom';
6
+ export interface ToolbarProps extends Component {
7
+ is?: 'div' | 'header' | 'nav';
8
+ variant?: Variant | {
9
+ [key: string]: Variant;
10
+ };
11
+ rounded?: string;
12
+ density?: Density | {
13
+ [key: string]: Density;
14
+ };
15
+ dark?: boolean;
16
+ light?: boolean;
17
+ color?: string;
18
+ orientation?: Orientation | {
19
+ [key: string]: Orientation;
20
+ };
21
+ background?: string;
22
+ location?: Location | {
23
+ [key: string]: Location;
24
+ };
25
+ classContent?: string | string[] | undefined;
26
+ }
27
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,124 @@
1
+ .kit-tooltip {
2
+ inset: 0px auto auto 0px;
3
+ margin: 0px;
4
+ position: fixed;
5
+ z-index: 2000;
6
+ }
7
+
8
+ .kit-tooltip-content {
9
+ --tooltip-color: var(--on, var(--kit-on-neutral));
10
+ --tooltip-background: var(--base, var(--kit-neutral));
11
+ --tooltip-radius: var(--shape, var(--kit-radius-md));
12
+
13
+ background-color: var(--tooltip-background);
14
+ color: var(--tooltip-color);
15
+ border-radius: var(--tooltip-radius);
16
+ border: 1px solid var(--tooltip-background);
17
+ font-size: 0.875rem;
18
+ display: inline-block;
19
+ width: auto;
20
+ pointer-events: none;
21
+ overflow-wrap: break-word;
22
+ transition:
23
+ color 0.5s,
24
+ border-color 0.5s,
25
+ background-color 0.5s;
26
+ box-shadow: 0px 16px 29px -10px color-mix(in oklab, var(--kit-scrim) 60%, transparent);
27
+ }
28
+
29
+ /* density */
30
+ .kit-tooltip-content[breakpoint]kit-tooltip-content--density-default {
31
+ padding: 0.15rem 0.625rem;
32
+ }
33
+
34
+ .kit-tooltip-content[breakpoint]kit-tooltip-content--density-compact {
35
+ padding: 0.125rem 0.5rem;
36
+ }
37
+
38
+ .kit-tooltip-content[breakpoint]kit-tooltip-content--density-comfortable {
39
+ padding: 0.35rem 0.75rem;
40
+ }
41
+
42
+ .kit-tooltip-content--arrow::after {
43
+ content: ' ';
44
+ position: absolute;
45
+ border-style: solid;
46
+ }
47
+
48
+ .kit-tooltip-content--arrow.kit-tooltip-content--bottom::after,
49
+ .kit-tooltip-content--arrow.kit-tooltip-content--top::after {
50
+ left: 50%;
51
+ margin-left: -0.35rem;
52
+ border-width: 0.35rem;
53
+ }
54
+
55
+ .kit-tooltip-content--arrow.kit-tooltip-content--bottom::after {
56
+ bottom: 100%;
57
+ border-color: transparent transparent var(--tooltip-background) transparent;
58
+ }
59
+
60
+ .kit-tooltip-content--arrow.kit-tooltip-content--top::after {
61
+ top: 100%;
62
+ border-color: var(--tooltip-background) transparent transparent transparent;
63
+ }
64
+
65
+ .kit-tooltip-content--arrow.kit-tooltip-content--left::after,
66
+ .kit-tooltip-content--arrow.kit-tooltip-content--right::after {
67
+ top: 50%;
68
+ margin-top: -0.35rem;
69
+ border-width: 0.35rem;
70
+ }
71
+
72
+ .kit-tooltip-content--arrow.kit-tooltip-content--right::after {
73
+ right: 100%;
74
+ border-color: transparent var(--tooltip-background) transparent transparent;
75
+ }
76
+
77
+ .kit-tooltip-content--arrow.kit-tooltip-content--left::after {
78
+ left: 100%;
79
+ border-color: transparent transparent transparent var(--tooltip-background);
80
+ }
81
+
82
+ .kit-tooltip-content--top,
83
+ .kit-tooltip-content--bottom,
84
+ .kit-tooltip-content--right,
85
+ .kit-tooltip-content--left {
86
+ animation-duration: 150ms;
87
+ animation-name: enter;
88
+ }
89
+
90
+ .kit-tooltip-content--top {
91
+ --animate-enter-pos1: 0;
92
+ --animate-enter-pos2: 0.5rem;
93
+ --animate-enter-pos3: 0;
94
+ }
95
+
96
+ .kit-tooltip-content--bottom {
97
+ --animate-enter-pos1: 0;
98
+ --animate-enter-pos2: -0.5rem;
99
+ --animate-enter-pos3: 0;
100
+ }
101
+
102
+ .kit-tooltip-content--right {
103
+ --animate-enter-pos1: -0.5rem;
104
+ --animate-enter-pos2: 0;
105
+ --animate-enter-pos3: 0;
106
+ }
107
+
108
+ .kit-tooltip-content--left {
109
+ --animate-enter-pos1: 0.5rem;
110
+ --animate-enter-pos2: 0;
111
+ --animate-enter-pos3: 0;
112
+ }
113
+
114
+ @keyframes enter {
115
+ 0% {
116
+ opacity: 0;
117
+ transform: translate3d(
118
+ var(--animate-enter-pos1),
119
+ var(--animate-enter-pos2),
120
+ var(--animate-enter-pos3)
121
+ )
122
+ scale3d(0.95, 0.95, 0.95) rotate(0);
123
+ }
124
+ }