@functionalcms/svelte-components 3.5.16 → 3.5.19

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 (129) hide show
  1. package/css/functional.css +1 -1
  2. package/css/functional.css.map +1 -1
  3. package/dist/components/Banner.svelte +1 -1
  4. package/dist/components/Banner.svelte.d.ts +8 -13
  5. package/dist/components/Link.svelte.d.ts +45 -34
  6. package/dist/components/Logo.svelte.d.ts +26 -22
  7. package/dist/components/Markdown.svelte.d.ts +5 -14
  8. package/dist/components/Spacer.svelte.d.ts +6 -14
  9. package/dist/components/Well.svelte.d.ts +11 -13
  10. package/dist/components/agnostic/Button/Button.svelte +333 -332
  11. package/dist/components/agnostic/Button/Button.svelte.d.ts +50 -39
  12. package/dist/components/agnostic/Button/ButtonGroup.svelte.d.ts +30 -19
  13. package/dist/components/agnostic/Close/Close.svelte.d.ts +22 -18
  14. package/dist/components/agnostic/Disclose/Disclose.svelte.d.ts +10 -13
  15. package/dist/components/agnostic/Divider/Divider.svelte.d.ts +21 -17
  16. package/dist/components/agnostic/Loader/Loader.svelte.d.ts +20 -16
  17. package/dist/components/blog/BlogDescription.svelte.d.ts +21 -17
  18. package/dist/components/blog/BlogTitle.svelte.d.ts +21 -17
  19. package/dist/components/form/DateTimePicker.svelte.d.ts +16 -12
  20. package/dist/components/form/Input.svelte +1 -1
  21. package/dist/components/form/Input.svelte.d.ts +46 -20
  22. package/dist/components/form/InputAddonItem.svelte +34 -34
  23. package/dist/components/form/InputAddonItem.svelte.d.ts +27 -27
  24. package/dist/components/form/Select.svelte.d.ts +32 -28
  25. package/dist/components/{agnostic/Switch → form}/Switch.svelte +1 -1
  26. package/dist/components/form/Switch.svelte.d.ts +30 -0
  27. package/dist/components/layouts/DefaultLayout.svelte.d.ts +11 -13
  28. package/dist/components/layouts/Meta.svelte.d.ts +10 -13
  29. package/dist/components/layouts/SimpleFooter.svelte.d.ts +7 -13
  30. package/dist/components/layouts/Tracker.svelte.d.ts +5 -13
  31. package/dist/components/layouts/TwoColumnsLayout.svelte.d.ts +9 -13
  32. package/dist/components/menu/CollapsibleMenu.svelte.d.ts +27 -23
  33. package/dist/components/menu/DynamicMenu.svelte.d.ts +27 -23
  34. package/dist/components/menu/HamburgerMenu.svelte +3 -3
  35. package/dist/components/menu/HamburgerMenu.svelte.d.ts +25 -21
  36. package/dist/components/menu/Menu.svelte.d.ts +31 -27
  37. package/dist/components/menu/MenuItem.svelte.d.ts +37 -25
  38. package/dist/components/menu/NavigationItems.svelte +9 -4
  39. package/dist/components/menu/NavigationItems.svelte.d.ts +27 -23
  40. package/dist/components/presentation/Card.svelte.d.ts +17 -13
  41. package/dist/components/presentation/Carousel/carousel-content.svelte +35 -0
  42. package/dist/components/presentation/Carousel/carousel-content.svelte.d.ts +28 -0
  43. package/dist/components/presentation/Carousel/carousel-item.svelte +25 -0
  44. package/dist/components/presentation/Carousel/carousel-item.svelte.d.ts +28 -0
  45. package/dist/components/presentation/Carousel/carousel-next.svelte +39 -0
  46. package/dist/components/presentation/Carousel/carousel-next.svelte.d.ts +18 -0
  47. package/dist/components/presentation/Carousel/carousel-previous.svelte +40 -0
  48. package/dist/components/presentation/Carousel/carousel-previous.svelte.d.ts +18 -0
  49. package/dist/components/presentation/Carousel/carousel.svelte +99 -0
  50. package/dist/components/presentation/Carousel/carousel.svelte.d.ts +31 -0
  51. package/dist/components/presentation/Carousel/context.d.ts +32 -0
  52. package/dist/components/presentation/Carousel/context.js +12 -0
  53. package/dist/components/presentation/Carousel.svelte +4 -0
  54. package/dist/components/presentation/Carousel.svelte.d.ts +18 -0
  55. package/dist/components/presentation/Carusele.d.ts +1 -1
  56. package/dist/components/presentation/Carusele.js +1 -1
  57. package/dist/components/presentation/Gallery.svelte.d.ts +14 -13
  58. package/dist/components/presentation/ImageCompare.svelte +15 -12
  59. package/dist/components/presentation/ImageCompare.svelte.d.ts +24 -38
  60. package/dist/index.d.ts +4 -5
  61. package/dist/index.js +12 -7
  62. package/package.json +24 -24
  63. package/dist/components/agnostic/Alert/Alert.svelte +0 -317
  64. package/dist/components/agnostic/Alert/Alert.svelte.d.ts +0 -29
  65. package/dist/components/agnostic/Avatar/Avatar.svelte +0 -127
  66. package/dist/components/agnostic/Avatar/Avatar.svelte.d.ts +0 -24
  67. package/dist/components/agnostic/Avatar/AvatarGroup.svelte +0 -106
  68. package/dist/components/agnostic/Avatar/AvatarGroup.svelte.d.ts +0 -27
  69. package/dist/components/agnostic/Breadcrumb/Breadcrumb.svelte +0 -65
  70. package/dist/components/agnostic/Breadcrumb/Breadcrumb.svelte.d.ts +0 -18
  71. package/dist/components/agnostic/Breadcrumb/api.d.ts +0 -4
  72. package/dist/components/agnostic/Breadcrumb/api.js +0 -1
  73. package/dist/components/agnostic/ChoiceInput/ChoiceInput.svelte +0 -365
  74. package/dist/components/agnostic/ChoiceInput/ChoiceInput.svelte.d.ts +0 -35
  75. package/dist/components/agnostic/ChoiceInput/api.d.ts +0 -7
  76. package/dist/components/agnostic/ChoiceInput/api.js +0 -1
  77. package/dist/components/agnostic/Dialog/Dialog.svelte +0 -278
  78. package/dist/components/agnostic/Dialog/Dialog.svelte.d.ts +0 -37
  79. package/dist/components/agnostic/Dialog/SvelteA11yDialog.svelte +0 -128
  80. package/dist/components/agnostic/Dialog/SvelteA11yDialog.svelte.d.ts +0 -28
  81. package/dist/components/agnostic/Dialog/a11y-dialog.d.ts +0 -56
  82. package/dist/components/agnostic/Dialog/a11y-dialog.js +0 -216
  83. package/dist/components/agnostic/Dialog/dom-utils.d.ts +0 -26
  84. package/dist/components/agnostic/Dialog/dom-utils.js +0 -206
  85. package/dist/components/agnostic/Drawer/Drawer.svelte +0 -34
  86. package/dist/components/agnostic/Drawer/Drawer.svelte.d.ts +0 -26
  87. package/dist/components/agnostic/Drawer/api.d.ts +0 -1
  88. package/dist/components/agnostic/Drawer/api.js +0 -1
  89. package/dist/components/agnostic/EmptyState/EmptyState.svelte +0 -49
  90. package/dist/components/agnostic/EmptyState/EmptyState.svelte.d.ts +0 -21
  91. package/dist/components/agnostic/Header/Header.svelte +0 -111
  92. package/dist/components/agnostic/Header/Header.svelte.d.ts +0 -24
  93. package/dist/components/agnostic/Header/HeaderNav.svelte +0 -29
  94. package/dist/components/agnostic/Header/HeaderNav.svelte.d.ts +0 -18
  95. package/dist/components/agnostic/Header/HeaderNavItem.svelte +0 -31
  96. package/dist/components/agnostic/Header/HeaderNavItem.svelte.d.ts +0 -18
  97. package/dist/components/agnostic/Icon/Icon.svelte +0 -188
  98. package/dist/components/agnostic/Icon/Icon.svelte.d.ts +0 -21
  99. package/dist/components/agnostic/Icon/api.d.ts +0 -2
  100. package/dist/components/agnostic/Icon/api.js +0 -1
  101. package/dist/components/agnostic/Progress/Progress.svelte +0 -51
  102. package/dist/components/agnostic/Progress/Progress.svelte.d.ts +0 -18
  103. package/dist/components/agnostic/Spinner/Spinner.svelte +0 -108
  104. package/dist/components/agnostic/Spinner/Spinner.svelte.d.ts +0 -17
  105. package/dist/components/agnostic/Switch/Switch.svelte.d.ts +0 -43
  106. package/dist/components/agnostic/Table/Table.svelte +0 -521
  107. package/dist/components/agnostic/Table/Table.svelte.d.ts +0 -34
  108. package/dist/components/agnostic/Table/TableCustomRenderComponent.svelte +0 -13
  109. package/dist/components/agnostic/Table/TableCustomRenderComponent.svelte.d.ts +0 -23
  110. package/dist/components/agnostic/Tabs/TabButtonCustom.svelte +0 -77
  111. package/dist/components/agnostic/Tabs/TabButtonCustom.svelte.d.ts +0 -33
  112. package/dist/components/agnostic/Tabs/Tabs.svelte +0 -399
  113. package/dist/components/agnostic/Tabs/Tabs.svelte.d.ts +0 -32
  114. package/dist/components/agnostic/Tabs/api.d.ts +0 -10
  115. package/dist/components/agnostic/Tabs/api.js +0 -1
  116. package/dist/components/agnostic/Tag/Tag.svelte +0 -78
  117. package/dist/components/agnostic/Tag/Tag.svelte.d.ts +0 -21
  118. package/dist/components/agnostic/Tag/TagSlots.svelte +0 -52
  119. package/dist/components/agnostic/Tag/TagSlots.svelte.d.ts +0 -14
  120. package/dist/components/agnostic/Toasts/Toasts.svelte +0 -56
  121. package/dist/components/agnostic/Toasts/Toasts.svelte.d.ts +0 -20
  122. package/dist/components/agnostic/Tooltip/Tooltip.svelte +0 -120
  123. package/dist/components/agnostic/Tooltip/Tooltip.svelte.d.ts +0 -21
  124. package/dist/components/agnostic/Tooltip/TooltipSlots.svelte +0 -82
  125. package/dist/components/agnostic/Tooltip/TooltipSlots.svelte.d.ts +0 -14
  126. package/dist/components/agnostic/Tooltip/api.d.ts +0 -1
  127. package/dist/components/agnostic/Tooltip/api.js +0 -1
  128. package/dist/components/presentation/Carusel.svelte +0 -109
  129. package/dist/components/presentation/Carusel.svelte.d.ts +0 -56
@@ -1,111 +0,0 @@
1
- <style>
2
- .header,
3
- .header-base {
4
- display: block;
5
- }
6
-
7
- .header-base :global(img),
8
- .header :global(img) {
9
- max-width: 100%;
10
- height: auto;
11
- }
12
-
13
- .header,
14
- .header-skin {
15
- background-color: var(--functional-header-background-color, var(--functional-light));
16
- box-shadow:
17
- var(--functional-header-box-shadow-hor, 0) var(--functional-header-box-shadow-ver, 1px)
18
- var(--functional-header-box-shadow-blur, 5px) var(--functional-header-box-shadow-spread, 2px)
19
- var(--functional-header-box-shadow-color, rgb(0 0 0 / 10%));
20
- font-family: var(--functional-header-font-family, var(--functional-font-family-body));
21
- border-bottom: 1px solid var(--functional-header-border-color, var(--functional-gray-light));
22
- padding-block-start: var(--functional-vertical-pad, 0.5rem);
23
- padding-block-end: var(--functional-vertical-pad, 0.5rem);
24
- padding-inline-start: var(--fluid-24);
25
- padding-inline-end: var(--fluid-24);
26
- }
27
-
28
- .header-content {
29
- width: var(--functional-header-content-width, 960px);
30
- max-width: 100%;
31
- margin: 0 auto;
32
- display: flex;
33
- justify-content: space-around;
34
- align-items: center;
35
- flex-flow: wrap column;
36
- }
37
-
38
- /**
39
- * If you make your header sticky, you should likely consider that jump links
40
- * e.g. <h1 id="Jump-Here">... will tuck underneath the header! Here's a recommendation
41
- * for how to circumnavigate this issue via scroll-margin-top:
42
- h1[id],
43
- h2[id],
44
- h3[id],
45
- h4[id],
46
- h5[id],
47
- h6[id] {
48
- scroll-margin-top: 80px;
49
- }
50
- * In this case I have a 64px tall header so I've added 16px for clearance -- you'll need
51
- * to curate your own use case, but scroll-margin-top is super useful for this use case.
52
- */
53
-
54
- .header-sticky {
55
- position: relative;
56
- top: 0;
57
- z-index: 10;
58
- }
59
-
60
- @media (min-width: 960px) {
61
- .header-sticky {
62
- position: sticky;
63
- }
64
-
65
- .header-content {
66
- flex-direction: row;
67
- justify-content: space-between;
68
- }
69
-
70
- .header-content-start {
71
- justify-content: flex-start;
72
- }
73
-
74
- .header-content-end {
75
- justify-content: flex-end;
76
- }
77
- }
78
-
79
- </style>
80
-
81
- <script lang="ts">
82
- export let isSticky = false;
83
- export let isSkinned = true;
84
- export let isHeaderContentStart = false;
85
- export let isHeaderContentEnd = false;
86
- export let css = "";
87
-
88
- const klasses: string = [
89
- isSkinned ? "header" : "header-base",
90
- isSticky ? "header-sticky" : "",
91
- css ? `${css}` : "",
92
- ]
93
- .filter((cl) => cl.length)
94
- .join(" ");
95
-
96
- const headerContentClasses: string = [
97
- "header-content",
98
- isHeaderContentStart ? "header-content-start" : "",
99
- isHeaderContentEnd ? "header-content-end" : "",
100
- ]
101
- .filter((cl) => cl.length)
102
- .join(" ");
103
- </script>
104
-
105
- <nav class={klasses}>
106
- <div class={headerContentClasses}>
107
- <slot name="logoleft" />
108
- <slot />
109
- <slot name="logoright" />
110
- </div>
111
- </nav>
@@ -1,24 +0,0 @@
1
- import { SvelteComponentTyped } from "svelte";
2
- declare const __propDef: {
3
- props: {
4
- isSticky?: boolean;
5
- isSkinned?: boolean;
6
- isHeaderContentStart?: boolean;
7
- isHeaderContentEnd?: boolean;
8
- css?: string;
9
- };
10
- events: {
11
- [evt: string]: CustomEvent<any>;
12
- };
13
- slots: {
14
- logoleft: {};
15
- default: {};
16
- logoright: {};
17
- };
18
- };
19
- export type HeaderProps = typeof __propDef.props;
20
- export type HeaderEvents = typeof __propDef.events;
21
- export type HeaderSlots = typeof __propDef.slots;
22
- export default class Header extends SvelteComponentTyped<HeaderProps, HeaderEvents, HeaderSlots> {
23
- }
24
- export {};
@@ -1,29 +0,0 @@
1
- <style>
2
- /* Goes on the <ul> */
3
- .header-nav {
4
- margin: 0;
5
- padding: 0;
6
- display: flex;
7
- flex-direction: column;
8
- align-items: center;
9
- }
10
-
11
- @media (min-width: 960px) {
12
- .header-nav {
13
- flex-direction: row;
14
- }
15
- }
16
-
17
- </style>
18
-
19
- <script lang="ts">
20
- export let css = "";
21
- const containerClasses = [css ? `${css}` : ""].filter((c) => c.length);
22
- </script>
23
-
24
- <nav class={containerClasses}>
25
- <ul class="header-nav">
26
- <slot />
27
- </ul>
28
- </nav>
29
-
@@ -1,18 +0,0 @@
1
- import { SvelteComponentTyped } from "svelte";
2
- declare const __propDef: {
3
- props: {
4
- css?: string;
5
- };
6
- events: {
7
- [evt: string]: CustomEvent<any>;
8
- };
9
- slots: {
10
- default: {};
11
- };
12
- };
13
- export type HeaderNavProps = typeof __propDef.props;
14
- export type HeaderNavEvents = typeof __propDef.events;
15
- export type HeaderNavSlots = typeof __propDef.slots;
16
- export default class HeaderNav extends SvelteComponentTyped<HeaderNavProps, HeaderNavEvents, HeaderNavSlots> {
17
- }
18
- export {};
@@ -1,31 +0,0 @@
1
- <style>
2
- .header-nav-item {
3
- display: inline-block;
4
- }
5
-
6
- .header-nav-item:not(:last-child) {
7
- margin-inline-end: initial;
8
- margin-block-end: var(--fluid-8);
9
- }
10
-
11
- .header-nav-item :global(a) {
12
- color: var(--functional-header-color, var(--functional-font-color));
13
- }
14
-
15
- @media (min-width: 960px) {
16
- .header-nav-item:not(:last-child) {
17
- margin-inline-end: var(--functional-header-nav-spacing, var(--fluid-32));
18
- margin-block-end: initial;
19
- }
20
- }
21
-
22
- </style>
23
-
24
- <script lang="ts">
25
- export let css = "";
26
- let klasses: string = ["header-nav-item", css ? `${css}` : ""].filter(cl => cl && cl.length).join(' ');
27
- </script>
28
-
29
- <li class={klasses}>
30
- <slot />
31
- </li>
@@ -1,18 +0,0 @@
1
- import { SvelteComponentTyped } from "svelte";
2
- declare const __propDef: {
3
- props: {
4
- css?: string;
5
- };
6
- events: {
7
- [evt: string]: CustomEvent<any>;
8
- };
9
- slots: {
10
- default: {};
11
- };
12
- };
13
- export type HeaderNavItemProps = typeof __propDef.props;
14
- export type HeaderNavItemEvents = typeof __propDef.events;
15
- export type HeaderNavItemSlots = typeof __propDef.slots;
16
- export default class HeaderNavItem extends SvelteComponentTyped<HeaderNavItemProps, HeaderNavItemEvents, HeaderNavItemSlots> {
17
- }
18
- export {};
@@ -1,188 +0,0 @@
1
- <style>
2
- .icon-base {
3
- display: inline-flex;
4
- text-align: center;
5
-
6
- /* Ensures no "stretching" of icons to reach 100% of container's width */
7
- max-width: 100%;
8
-
9
- /* Ensure SVGs don't have click events -- typically we want enclosing button to handle */
10
- pointer-events: none;
11
- user-select: none;
12
- }
13
-
14
- /* We need to make both the span and svg same height (span .icon-svg) */
15
- .icon,
16
- .icon-skin {
17
- width: var(--fluid-16);
18
- height: var(--fluid-16);
19
- }
20
-
21
- .icon-14 {
22
- width: var(--fluid-14);
23
- height: var(--fluid-14);
24
- }
25
-
26
- .icon-16 {
27
- width: var(--fluid-16);
28
- height: var(--fluid-16);
29
- }
30
-
31
- .icon-18 {
32
- width: var(--fluid-18);
33
- height: var(--fluid-18);
34
- }
35
-
36
- .icon-20 {
37
- width: var(--fluid-20);
38
- height: var(--fluid-20);
39
- }
40
-
41
- .icon-24,
42
- .icon-svg-24 {
43
- width: var(--fluid-24);
44
- height: var(--fluid-24);
45
- }
46
-
47
- .icon-32 {
48
- width: var(--fluid-32);
49
- height: var(--fluid-32);
50
- }
51
-
52
- .icon-36 {
53
- width: var(--fluid-36);
54
- height: var(--fluid-36);
55
- }
56
-
57
- .icon-40 {
58
- width: var(--fluid-40);
59
- height: var(--fluid-40);
60
- }
61
-
62
- .icon-48 {
63
- width: var(--fluid-48);
64
- height: var(--fluid-48);
65
- }
66
-
67
- .icon-56 {
68
- width: var(--fluid-56);
69
- height: var(--fluid-56);
70
- }
71
-
72
- .icon-64 {
73
- width: var(--fluid-64);
74
- height: var(--fluid-64);
75
- }
76
-
77
- :global(.icon-svg) {
78
- width: var(--fluid-16);
79
- height: var(--fluid-16);
80
- fill: currentColor;
81
- }
82
-
83
- :global(.icon-svg-14) {
84
- width: var(--fluid-14);
85
- height: var(--fluid-14);
86
- }
87
-
88
- :global(.icon-svg-16) {
89
- width: var(--fluid-16);
90
- height: var(--fluid-16);
91
- }
92
-
93
- :global(.icon-svg-18) {
94
- width: var(--fluid-18);
95
- height: var(--fluid-18);
96
- }
97
-
98
- :global(.icon-svg-20) {
99
- width: var(--fluid-20);
100
- height: var(--fluid-20);
101
- }
102
-
103
- :global(.icon-svg-24) {
104
- width: var(--fluid-24);
105
- height: var(--fluid-24);
106
- }
107
-
108
- :global(.icon-svg-32) {
109
- width: var(--fluid-32);
110
- height: var(--fluid-32);
111
- }
112
-
113
- :global(.icon-svg-36) {
114
- width: var(--fluid-36);
115
- height: var(--fluid-36);
116
- }
117
-
118
- :global(.icon-svg-40) {
119
- width: var(--fluid-40);
120
- height: var(--fluid-40);
121
- }
122
-
123
- :global(.icon-svg-48) {
124
- width: var(--fluid-48);
125
- height: var(--fluid-48);
126
- }
127
-
128
- :global(.icon-svg-56) {
129
- width: var(--fluid-56);
130
- height: var(--fluid-56);
131
- }
132
-
133
- :global(.icon-svg-64) {
134
- width: var(--fluid-64);
135
- height: var(--fluid-64);
136
- }
137
-
138
- :global(.icon-svg-info) {
139
- color: var(--functional-primary);
140
- }
141
-
142
- :global(.icon-svg-action),
143
- :global(.icon-svg-success) {
144
- color: var(--functional-action);
145
- }
146
-
147
- :global(.icon-svg-warning) {
148
- color: var(--functional-warning-border-accent);
149
- }
150
-
151
- :global(.icon-svg-error) {
152
- color: var(--functional-error);
153
- }
154
- </style>
155
-
156
- <script lang="ts">
157
- import { onMount } from 'svelte';
158
- import type { IconSize, IconType } from './api';
159
- export let type: IconType = '';
160
- export let size: IconSize = 14;
161
- export let isSkinned = true;
162
- let spanRef;
163
-
164
- const iconClasses = [
165
- "screenreader-only",
166
- isSkinned ? "icon" : "icon-base",
167
- type ? `icon-${type}` : "",
168
- size ? `icon-${size}` : "",
169
- ]
170
- .filter((cls) => cls)
171
- .join(" ");
172
-
173
- onMount(() => {
174
- const svg = spanRef.querySelector("svg");
175
- svg.classList.add("icon-svg");
176
- if (svg) {
177
- if (size) svg.classList.add(`icon-svg-${size}`);
178
- if (type) svg.classList.add(`icon-svg-${type}`);
179
-
180
- // Now that we've setup our SVG classes we can visually unhide the icon
181
- spanRef.classList.remove("screenreader-only");
182
- }
183
- });
184
- </script>
185
-
186
- <span bind:this={spanRef} class={iconClasses}>
187
- <slot />
188
- </span>
@@ -1,21 +0,0 @@
1
- import { SvelteComponentTyped } from "svelte";
2
- import type { IconSize, IconType } from './api';
3
- declare const __propDef: {
4
- props: {
5
- type?: IconType;
6
- size?: IconSize;
7
- isSkinned?: boolean;
8
- };
9
- events: {
10
- [evt: string]: CustomEvent<any>;
11
- };
12
- slots: {
13
- default: {};
14
- };
15
- };
16
- export type IconProps = typeof __propDef.props;
17
- export type IconEvents = typeof __propDef.events;
18
- export type IconSlots = typeof __propDef.slots;
19
- export default class Icon extends SvelteComponentTyped<IconProps, IconEvents, IconSlots> {
20
- }
21
- export {};
@@ -1,2 +0,0 @@
1
- export type IconSize = 14 | 16 | 18 | 20 | 24 | 32 | 36 | 40 | 48 | 56 | 64;
2
- export type IconType = "warning" | "error" | "info" | "success" | "";
@@ -1 +0,0 @@
1
- export {};
@@ -1,51 +0,0 @@
1
- <style>
2
- /* https://stackoverflow.com/questions/45507970/how-can-i-change-the-color-of-a-progress-bar-value-in-html */
3
-
4
- /**
5
- * Most examples show styling directly to the <progress> element itself. However,
6
- * my tests (chrome, ff, safari on mac mini 2020), showed it's perfectly possibly
7
- * to use a class selector instead. The reason I'd prefer that here, is that I can
8
- * then use CSS Modules composes against .progress (e.g. for React/Vue components)
9
- */
10
- .progress {
11
- appearance: none;
12
- height: var(--functional-progress-height, var(--fluid-10, 0.625rem));
13
- width: 100%;
14
- border: none;
15
-
16
- /* Next couple of rules are required to be here for FF (but not chrome) */
17
- background-color: var(--functional-progress-background, var(--functional-gray-light, #ededed));
18
- border-radius: var(--functional-progress-radius, var(--fluid-10, 0.625rem));
19
- }
20
-
21
- .progress[value]::-webkit-progress-bar {
22
- /* In my tests chrome requires this whereas FF wants it on the progress {} rule */
23
- background-color: var(--functional-progress-background, var(--functional-gray-light, #ededed));
24
- border-radius: var(--functional-progress-radius, var(--fluid-10, 0.625rem));
25
- }
26
-
27
- .progress[value]::-webkit-progress-value {
28
- background-color: var(--functional-progress-fill-color, var(--functional-primary, #077acb));
29
- border-radius: var(--functional-progress-radius, var(--fluid-10, 0.625rem));
30
- }
31
-
32
- .progress[value]::-moz-progress-bar {
33
- background-color: var(--functional-progress-fill-color, var(--functional-primary, #077acb));
34
- border-radius: var(--functional-progress-radius, var(--fluid-10, 0.625rem));
35
- }
36
-
37
- .progress[value]::-ms-fill {
38
- background-color: var(--functional-progress-fill-color, var(--functional-primary, #077acb));
39
- border-radius: var(--functional-progress-radius, var(--fluid-10, 0.625rem));
40
- }
41
-
42
- </style>
43
-
44
- <script lang="ts">
45
- export let value = 0;
46
- export let max;
47
- export let css = "";
48
- let klasses: string = ["progress", css ? `${css}` : ""].filter(cl => cl && cl.length).join(' ');
49
- </script>
50
-
51
- <progress class={klasses} value={value} max={max}></progress>
@@ -1,18 +0,0 @@
1
- import { SvelteComponentTyped } from "svelte";
2
- declare const __propDef: {
3
- props: {
4
- value?: number;
5
- max: any;
6
- css?: string;
7
- };
8
- events: {
9
- [evt: string]: CustomEvent<any>;
10
- };
11
- slots: {};
12
- };
13
- export type ProgressProps = typeof __propDef.props;
14
- export type ProgressEvents = typeof __propDef.events;
15
- export type ProgressSlots = typeof __propDef.slots;
16
- export default class Progress extends SvelteComponentTyped<ProgressProps, ProgressEvents, ProgressSlots> {
17
- }
18
- export {};
@@ -1,108 +0,0 @@
1
- <style>
2
- .spinner {
3
- --spinner-color: var(--functional-spinner-color, var(--functional-dark));
4
-
5
- /**
6
- * Inspiration to utilize grid for this from
7
- * https://dockyard.com/blog/2020/03/02/accessible-loading-indicatorswith-no-extra-elements
8
- */
9
- display: grid;
10
- grid-template: "content" 100% / auto;
11
- place-items: center;
12
- box-sizing: border-box;
13
- }
14
-
15
- .spinner::before,
16
- .spinner::after {
17
- grid-area: content;
18
- width: var(--fluid-32);
19
- height: var(--fluid-32);
20
- content: "";
21
- display: block;
22
- border-radius: 50%;
23
- border-width: 3px;
24
- border-style: solid;
25
- }
26
-
27
- .spinner-small::before,
28
- .spinner-small::after {
29
- width: var(--fluid-24);
30
- height: var(--fluid-24);
31
- border-width: var(--fluid-2);
32
- }
33
-
34
- .spinner-large::before,
35
- .spinner-large::after {
36
- width: var(--fluid-40);
37
- height: var(--fluid-40);
38
- border-width: var(--fluid-4);
39
- }
40
-
41
- .spinner-xlarge::before,
42
- .spinner-xlarge::after {
43
- width: var(--fluid-56);
44
- height: var(--fluid-56);
45
- border-width: var(--fluid-6);
46
- }
47
-
48
- /**
49
- * Before is the muted background
50
- */
51
- .spinner::before {
52
- opacity: 0%;
53
- border-color: var(--spinner-color);
54
- }
55
-
56
- /**
57
- * After is the inner "snake"
58
- */
59
- .spinner::after {
60
- opacity: 0%;
61
- border-color: transparent var(--spinner-color) transparent transparent;
62
- transition: opacity 0.1s;
63
- pointer-events: none;
64
- animation: loading-circle 1s ease-in-out infinite;
65
-
66
- /* TODO Research the whole null transform hack. It is quite confusing to figure out if it
67
- is beneficial or detrimental: See
68
- https://newbedev.com/css-keyframe-animation-cpu-usage-is-high-should-it-be-this-way
69
- transform: translateZ(0);
70
- will-change: transform; */
71
- }
72
-
73
- /**
74
- * Setting aria-busy to true results in corresponding opacity change to visually show spinner.
75
- */
76
- .spinner[aria-busy="true"]::before {
77
- opacity: 12%;
78
- }
79
-
80
- .spinner[aria-busy="true"]::after {
81
- opacity: 100%;
82
- }
83
-
84
- @keyframes loading-circle {
85
- to {
86
- transform: rotate(360deg);
87
- }
88
- }
89
-
90
- @media (prefers-reduced-motion), (update: slow) {
91
- .spinner::after {
92
- transition-duration: 0.001ms !important;
93
- }
94
- }
95
-
96
- </style>
97
-
98
- <script lang="ts">
99
- export let ariaLabel = "Loading…";
100
- export let size: "small" | "large" | "xlarge" | "" = "";
101
- $: spinnerClasses = ["spinner", size ? `spinner-${size}` : ""]
102
- .filter((c) => c)
103
- .join(" ");
104
- </script>
105
-
106
- <div class={spinnerClasses} role="status" aria-live="polite" aria-busy="true">
107
- <span class="screenreader-only">{ariaLabel}</span>
108
- </div>
@@ -1,17 +0,0 @@
1
- import { SvelteComponentTyped } from "svelte";
2
- declare const __propDef: {
3
- props: {
4
- ariaLabel?: string;
5
- size?: "small" | "large" | "xlarge" | "";
6
- };
7
- events: {
8
- [evt: string]: CustomEvent<any>;
9
- };
10
- slots: {};
11
- };
12
- export type SpinnerProps = typeof __propDef.props;
13
- export type SpinnerEvents = typeof __propDef.events;
14
- export type SpinnerSlots = typeof __propDef.slots;
15
- export default class Spinner extends SvelteComponentTyped<SpinnerProps, SpinnerEvents, SpinnerSlots> {
16
- }
17
- export {};
@@ -1,43 +0,0 @@
1
- /** @typedef {typeof __propDef.props} SwitchProps */
2
- /** @typedef {typeof __propDef.events} SwitchEvents */
3
- /** @typedef {typeof __propDef.slots} SwitchSlots */
4
- export default class Switch extends SvelteComponentTyped<{
5
- size?: string | undefined;
6
- label?: string | undefined;
7
- id?: string | undefined;
8
- isBordered?: boolean | undefined;
9
- isDisabled?: boolean | undefined;
10
- css?: string | undefined;
11
- labelPosition?: string | undefined;
12
- isChecked?: boolean | undefined;
13
- isAction?: boolean | undefined;
14
- }, {
15
- change: Event;
16
- } & {
17
- [evt: string]: CustomEvent<any>;
18
- }, {}> {
19
- }
20
- export type SwitchProps = typeof __propDef.props;
21
- export type SwitchEvents = typeof __propDef.events;
22
- export type SwitchSlots = typeof __propDef.slots;
23
- import { SvelteComponentTyped } from "svelte";
24
- declare const __propDef: {
25
- props: {
26
- size?: string | undefined;
27
- label?: string | undefined;
28
- id?: string | undefined;
29
- isBordered?: boolean | undefined;
30
- isDisabled?: boolean | undefined;
31
- css?: string | undefined;
32
- labelPosition?: string | undefined;
33
- isChecked?: boolean | undefined;
34
- isAction?: boolean | undefined;
35
- };
36
- events: {
37
- change: Event;
38
- } & {
39
- [evt: string]: CustomEvent<any>;
40
- };
41
- slots: {};
42
- };
43
- export {};