fluent-svelte-extra 1.0.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 (145) hide show
  1. package/.prettierignore +1 -0
  2. package/.prettierrc +7 -0
  3. package/CHANGELOG.md +7 -0
  4. package/LICENSE +21 -0
  5. package/README.md +33 -0
  6. package/package.json +83 -0
  7. package/src/app.html +12 -0
  8. package/src/global.d.ts +1 -0
  9. package/src/lib/AutoSuggestBox/AutoSuggestBox.scss +44 -0
  10. package/src/lib/AutoSuggestBox/AutoSuggestBox.svelte +173 -0
  11. package/src/lib/Button/Button.scss +94 -0
  12. package/src/lib/Button/Button.svelte +48 -0
  13. package/src/lib/CalendarDatePicker/CalendarDatePicker.scss +15 -0
  14. package/src/lib/CalendarDatePicker/CalendarDatePicker.svelte +86 -0
  15. package/src/lib/CalendarView/CalendarView.scss +156 -0
  16. package/src/lib/CalendarView/CalendarView.svelte +753 -0
  17. package/src/lib/CalendarView/CalendarViewItem.scss +130 -0
  18. package/src/lib/CalendarView/CalendarViewItem.svelte +33 -0
  19. package/src/lib/Checkbox/Checkbox.scss +117 -0
  20. package/src/lib/Checkbox/Checkbox.svelte +81 -0
  21. package/src/lib/ComboBox/ComboBox.scss +152 -0
  22. package/src/lib/ComboBox/ComboBox.svelte +360 -0
  23. package/src/lib/ComboBox/ComboBoxItem.scss +80 -0
  24. package/src/lib/ComboBox/ComboBoxItem.svelte +30 -0
  25. package/src/lib/ContentDialog/ContentDialog.scss +68 -0
  26. package/src/lib/ContentDialog/ContentDialog.svelte +123 -0
  27. package/src/lib/ContextMenu/ContextMenu.scss +11 -0
  28. package/src/lib/ContextMenu/ContextMenu.svelte +104 -0
  29. package/src/lib/Expander/Expander.scss +134 -0
  30. package/src/lib/Expander/Expander.svelte +123 -0
  31. package/src/lib/Flipper/Flipper.svelte +49 -0
  32. package/src/lib/Flyout/FlyoutSurface.scss +14 -0
  33. package/src/lib/Flyout/FlyoutSurface.svelte +21 -0
  34. package/src/lib/Flyout/FlyoutWrapper.scss +81 -0
  35. package/src/lib/Flyout/FlyoutWrapper.svelte +126 -0
  36. package/src/lib/IconButton/IconButton.scss +31 -0
  37. package/src/lib/IconButton/IconButton.svelte +49 -0
  38. package/src/lib/InfoBadge/InfoBadge.scss +39 -0
  39. package/src/lib/InfoBadge/InfoBadge.svelte +81 -0
  40. package/src/lib/InfoBar/InfoBar.scss +122 -0
  41. package/src/lib/InfoBar/InfoBar.svelte +133 -0
  42. package/src/lib/ListItem/ListItem.scss +74 -0
  43. package/src/lib/ListItem/ListItem.svelte +88 -0
  44. package/src/lib/MenuBar/MenuBar.scss +10 -0
  45. package/src/lib/MenuBar/MenuBar.svelte +49 -0
  46. package/src/lib/MenuBar/MenuBarItem.scss +38 -0
  47. package/src/lib/MenuBar/MenuBarItem.svelte +135 -0
  48. package/src/lib/MenuBar/flyoutState.ts +5 -0
  49. package/src/lib/MenuFlyout/MenuFlyoutDivider.scss +7 -0
  50. package/src/lib/MenuFlyout/MenuFlyoutDivider.svelte +14 -0
  51. package/src/lib/MenuFlyout/MenuFlyoutItem.scss +147 -0
  52. package/src/lib/MenuFlyout/MenuFlyoutItem.svelte +239 -0
  53. package/src/lib/MenuFlyout/MenuFlyoutSurface.scss +42 -0
  54. package/src/lib/MenuFlyout/MenuFlyoutSurface.svelte +28 -0
  55. package/src/lib/MenuFlyout/MenuFlyoutWrapper.scss +64 -0
  56. package/src/lib/MenuFlyout/MenuFlyoutWrapper.svelte +114 -0
  57. package/src/lib/NavigationView/NavigationView.scss +0 -0
  58. package/src/lib/NavigationView/NavigationView.svelte +82 -0
  59. package/src/lib/NumberBox/NumberBox.scss +31 -0
  60. package/src/lib/NumberBox/NumberBox.svelte +267 -0
  61. package/src/lib/PersonPicture/PersonPicture.scss +35 -0
  62. package/src/lib/PersonPicture/PersonPicture.svelte +62 -0
  63. package/src/lib/ProgressBar/ProgressBar.scss +83 -0
  64. package/src/lib/ProgressBar/ProgressBar.svelte +60 -0
  65. package/src/lib/ProgressRing/ProgressRing.scss +37 -0
  66. package/src/lib/ProgressRing/ProgressRing.svelte +73 -0
  67. package/src/lib/RadioButton/RadioButton.scss +114 -0
  68. package/src/lib/RadioButton/RadioButton.svelte +67 -0
  69. package/src/lib/RangeSlider/RangeSlider.svelte +91 -0
  70. package/src/lib/ScrollView/ScrollView.svelte +9 -0
  71. package/src/lib/Slider/Slider.scss +263 -0
  72. package/src/lib/Slider/Slider.svelte +261 -0
  73. package/src/lib/TextBlock/TextBlock.scss +62 -0
  74. package/src/lib/TextBlock/TextBlock.svelte +70 -0
  75. package/src/lib/TextBox/TextBox.scss +108 -0
  76. package/src/lib/TextBox/TextBox.svelte +225 -0
  77. package/src/lib/TextBox/TextBoxButton.scss +34 -0
  78. package/src/lib/TextBox/TextBoxButton.svelte +27 -0
  79. package/src/lib/ToggleSwitch/ToggleSwitch.scss +118 -0
  80. package/src/lib/ToggleSwitch/ToggleSwitch.svelte +55 -0
  81. package/src/lib/Tooltip/TooltipSurface.scss +16 -0
  82. package/src/lib/Tooltip/TooltipSurface.svelte +27 -0
  83. package/src/lib/Tooltip/TooltipWrapper.scss +66 -0
  84. package/src/lib/Tooltip/TooltipWrapper.svelte +117 -0
  85. package/src/lib/_mixins.scss +130 -0
  86. package/src/lib/index.ts +33 -0
  87. package/src/lib/internal.ts +213 -0
  88. package/src/lib/svelte-jsx.d.ts +14 -0
  89. package/src/lib/theme.css +414 -0
  90. package/src/routes/__layout.svelte +48 -0
  91. package/src/routes/docs/__layout.svelte +122 -0
  92. package/src/routes/docs/components/button.md +43 -0
  93. package/src/routes/docs/components/calendarview.md +188 -0
  94. package/src/routes/docs/components/checkbox.md +87 -0
  95. package/src/routes/docs/components/contentdialog.md +155 -0
  96. package/src/routes/docs/components/expander.md +115 -0
  97. package/src/routes/docs/components/flyout.md +107 -0
  98. package/src/routes/docs/components/iconbutton.md +39 -0
  99. package/src/routes/docs/components/infobadge.md +54 -0
  100. package/src/routes/docs/components/infobar.md +102 -0
  101. package/src/routes/docs/components/listitem.md +87 -0
  102. package/src/routes/docs/components/personpicture.md +125 -0
  103. package/src/routes/docs/components/progressring.md +83 -0
  104. package/src/routes/docs/components/radiobutton.md +88 -0
  105. package/src/routes/docs/components/slider.md +165 -0
  106. package/src/routes/docs/components/textblock.md +46 -0
  107. package/src/routes/docs/components/textbox.md +124 -0
  108. package/src/routes/docs/components/toggleswitch.md +73 -0
  109. package/src/routes/docs/getting-started.md +116 -0
  110. package/src/routes/docs/index.md +37 -0
  111. package/src/routes/docs/internals/index.md +0 -0
  112. package/src/routes/index.svelte +121 -0
  113. package/src/routes/test/__layout-test.svelte +1 -0
  114. package/src/routes/test/index.svelte +757 -0
  115. package/src/routes/test/nav.svelte +7 -0
  116. package/src/site/data/docs.ts +176 -0
  117. package/src/site/data/home.ts +12 -0
  118. package/src/site/lib/APIDocs/APIDocs.svelte +178 -0
  119. package/src/site/lib/APIDocs/ParsedComponent.d.ts +85 -0
  120. package/src/site/lib/CopyBox/CopyBox.svelte +23 -0
  121. package/src/site/lib/Example/Example.scss +33 -0
  122. package/src/site/lib/Example/Example.svelte +18 -0
  123. package/src/site/lib/HeroCard/HeroCard.scss +24 -0
  124. package/src/site/lib/HeroCard/HeroCard.svelte +36 -0
  125. package/src/site/lib/Metadata/Metadata.svelte +14 -0
  126. package/src/site/lib/Navbar/Navbar.scss +92 -0
  127. package/src/site/lib/Navbar/Navbar.svelte +47 -0
  128. package/src/site/lib/PageSection/PageSection.scss +57 -0
  129. package/src/site/lib/PageSection/PageSection.svelte +10 -0
  130. package/src/site/lib/Showcase/Showcase.scss +53 -0
  131. package/src/site/lib/Showcase/Showcase.svelte +67 -0
  132. package/src/site/lib/Toc/Toc.scss +18 -0
  133. package/src/site/lib/Toc/Toc.svelte +59 -0
  134. package/src/site/lib/TreeView/TreeView.svelte +89 -0
  135. package/src/site/lib/index.ts +9 -0
  136. package/src/site/styles/_markdown.scss +260 -0
  137. package/src/site/styles/_mixins.scss +319 -0
  138. package/src/site/styles/global.scss +40 -0
  139. package/src/site/styles/pages/docs.scss +74 -0
  140. package/src/site/styles/pages/home.scss +134 -0
  141. package/static/bloom-mica-dark.png +0 -0
  142. package/static/bloom-mica-light.png +0 -0
  143. package/static/logo.svg +11 -0
  144. package/svelte.config.js +57 -0
  145. package/tsconfig.json +38 -0
@@ -0,0 +1,261 @@
1
+ <script lang="ts">
2
+ import { createEventForwarder, TooltipSurface } from "$lib/internal";
3
+ import { createEventDispatcher } from "svelte";
4
+ import { get_current_component } from "svelte/internal";
5
+
6
+ /** The slider's current value. */
7
+ export let value = 0;
8
+
9
+ /** The minimum value of the slider. */
10
+ export let min = 0;
11
+
12
+ /** The maximum value of the slider. */
13
+ export let max = 100;
14
+
15
+ /** Determines how much the slider's value should increase per step. */
16
+ export let step: number = 1;
17
+
18
+ /** Determines the position of slider ticks along the min and max of the track. */
19
+ export let ticks: number[] = [];
20
+
21
+ /** Determines the placement of slider ticks around the track. */
22
+ export let tickPlacement: "around" | "before" | "after" = "around";
23
+
24
+ /** Determines if the slider's value tooltip will be shown. */
25
+ export let tooltip = true;
26
+
27
+ /** Text placed before the slider's value tooltip. */
28
+ export let prefix = "";
29
+
30
+ /** Text placed after the slider's value tooltip. */
31
+ export let suffix = "";
32
+
33
+ /** Determines if the slider's fill track will be visible or not. */
34
+ export let track = true;
35
+
36
+ /** Determines the slider's orientation. */
37
+ export let orientation: "vertical" | "horizontal" = "horizontal";
38
+
39
+ /** Determines if the slider track will be in reverse direction. */
40
+ export let reverse = false;
41
+
42
+ /** Controls whether the slider is disabled. */
43
+ export let disabled = false;
44
+
45
+ /** Specifies a custom class name for the slider's container element. */
46
+ let className = "";
47
+ export { className as class };
48
+
49
+ /** Obtains a bound DOM reference to the slider's input element. */
50
+ export let inputElement: HTMLInputElement = null;
51
+
52
+ /** Obtains a bound DOM reference to the slider's outer container element. */
53
+ export let containerElement: HTMLDivElement = null;
54
+
55
+ /** Obtains a bound DOM reference to the slider's tick container element. */
56
+ export let tickBarElement: HTMLDivElement = null;
57
+
58
+ /** Obtains a bound DOM reference to the slider's thumb element. */
59
+ export let thumbElement: HTMLDivElement = null;
60
+
61
+ /** Obtains a bound DOM reference to the slider's outer rail element. */
62
+ export let railElement: HTMLDivElement = null;
63
+
64
+ /** Obtains a bound DOM reference to the slider's track (fill) element. */
65
+ export let trackElement: HTMLDivElement = null;
66
+
67
+ let dragging = false;
68
+ let holding = false;
69
+ let directionAwareReverse = false;
70
+ let thumbClientWidth = 20;
71
+
72
+ $: if (containerElement) {
73
+ directionAwareReverse =
74
+ window?.getComputedStyle(containerElement).direction === "ltr" ? reverse : !reverse;
75
+ }
76
+
77
+ const dispatch = createEventDispatcher();
78
+ const forwardEvents = createEventForwarder(get_current_component(), [
79
+ "input",
80
+ "change",
81
+ "beforeinput"
82
+ ]);
83
+
84
+ // Divides the current value minus the minimum value
85
+ // by the difference between the max and min values,
86
+ // and multiplies by 100 to get a percentage.
87
+ const valueToPercentage = v => ((v - min) / (max - min)) * 100;
88
+
89
+ function cancelMove() {
90
+ holding = false;
91
+ dragging = false;
92
+ }
93
+
94
+ function handleMove() {
95
+ if (holding) dragging = true;
96
+ }
97
+
98
+ function calculateValue(event) {
99
+ if (disabled || !railElement) return;
100
+ const { top, bottom, left, right, width, height } = railElement.getBoundingClientRect();
101
+ const percentageX = event.touches ? event.touches[0].clientX : event.clientX;
102
+ const percentageY = event.touches ? event.touches[0].clientY : event.clientY;
103
+
104
+ const position = orientation === "horizontal" ? percentageX : percentageY;
105
+ const startingPos =
106
+ orientation === "horizontal"
107
+ ? directionAwareReverse
108
+ ? right
109
+ : left
110
+ : directionAwareReverse
111
+ ? top
112
+ : bottom;
113
+ const length = orientation === "horizontal" ? width : height;
114
+
115
+ let nextStep =
116
+ min +
117
+ Math.round(
118
+ ((max - min) *
119
+ ((position - startingPos) / length) *
120
+ (directionAwareReverse ? -1 : 1) *
121
+ (orientation === "vertical" ? -1 : 1)) /
122
+ step
123
+ ) *
124
+ step;
125
+
126
+ if (nextStep <= min) nextStep = min;
127
+ else if (nextStep >= max) nextStep = max;
128
+
129
+ value = nextStep;
130
+ }
131
+
132
+ function handleArrowKeys(event) {
133
+ const { key } = event;
134
+
135
+ if (key === "ArrowDown" || key === "ArrowUp") event.preventDefault();
136
+ if (key === "ArrowLeft" || (key === "ArrowDown" && !disabled)) {
137
+ if (reverse) {
138
+ stepUp();
139
+ } else {
140
+ stepDown();
141
+ }
142
+ } else if (key === "ArrowRight" || (key === "ArrowUp" && !disabled)) {
143
+ if (reverse) {
144
+ stepDown();
145
+ } else {
146
+ stepUp();
147
+ }
148
+ }
149
+ }
150
+
151
+ function handleTouchStart(event) {
152
+ if (event.cancelable) event.preventDefault();
153
+ holding = true;
154
+ }
155
+
156
+ function linearScale(input: readonly [number, number], output: readonly [number, number]) {
157
+ return (value: number) => {
158
+ if (input[0] === input[1] || output[0] === output[1]) return output[0];
159
+ const ratio = (output[1] - output[0]) / (input[1] - input[0]);
160
+ return output[0] + ratio * (value - input[0]);
161
+ };
162
+ }
163
+
164
+ export function stepUp() {
165
+ value += step;
166
+ if (value > max) value = max;
167
+ }
168
+
169
+ export function stepDown() {
170
+ value -= step;
171
+ if (value < min) value = min;
172
+ }
173
+
174
+ $: dispatch("change", value);
175
+ $: percentage = valueToPercentage(value);
176
+ $: {
177
+ if (value <= min) value = min;
178
+ else if (value >= max) value = max;
179
+
180
+ if (dragging) {
181
+ calculateValue(event);
182
+ dragging = false;
183
+ }
184
+ }
185
+ </script>
186
+
187
+ <svelte:window
188
+ on:mousemove={handleMove}
189
+ on:touchmove={handleMove}
190
+ on:mouseup={cancelMove}
191
+ on:touchend={cancelMove}
192
+ on:touchcancel={cancelMove}
193
+ />
194
+
195
+ <!--
196
+ @component
197
+ A slider is a control that lets the user select from a range of values by moving a thumb control along a track. [Docs](https://fluent-svelte.vercel.app/docs/components/slider)
198
+ - Usage:
199
+ ```tsx
200
+ <Slider bind:value min={-100} max={100} step={10} ticks={[-50, 0, 50]} />
201
+ ```
202
+ -->
203
+ <div
204
+ use:forwardEvents
205
+ on:mousedown|preventDefault={() => {
206
+ holding = true;
207
+ dragging = true;
208
+ }}
209
+ on:touchstart={handleTouchStart}
210
+ on:keydown={handleArrowKeys}
211
+ tabindex={disabled ? -1 : 0}
212
+ style="--fds-slider-percentage: {percentage}%; --fds-slider-thumb-offset: {thumbClientWidth /
213
+ 2 -
214
+ linearScale([0, 50], [0, thumbClientWidth / 2])(percentage)}px;"
215
+ class="slider orientation-{orientation} {className}"
216
+ class:disabled
217
+ class:reverse={directionAwareReverse}
218
+ bind:this={containerElement}
219
+ {...$$restProps}
220
+ >
221
+ <div
222
+ class="slider-thumb"
223
+ role="slider"
224
+ aria-valuemin={min}
225
+ aria-valuemax={max}
226
+ aria-valuenow={value}
227
+ bind:this={thumbElement}
228
+ bind:clientWidth={thumbClientWidth}
229
+ >
230
+ {#if tooltip && !disabled}
231
+ <TooltipSurface class="slider-tooltip">
232
+ <slot name="tooltip" {prefix} {suffix} {value}>
233
+ {prefix}{value}{suffix}
234
+ </slot>
235
+ </TooltipSurface>
236
+ {/if}
237
+ </div>
238
+
239
+ <div class="slider-rail" bind:this={railElement}>
240
+ {#if track}
241
+ <div class="slider-track" bind:this={trackElement} />
242
+ {/if}
243
+ </div>
244
+
245
+ {#if ticks}
246
+ <div class="slider-tick-bar placement-{tickPlacement}" bind:this={tickBarElement}>
247
+ {#each ticks as tick}
248
+ <div
249
+ class="slider-tick"
250
+ style="--fds-slider-tick-percentage: {valueToPercentage(tick)}%"
251
+ />
252
+ {/each}
253
+ </div>
254
+ {/if}
255
+
256
+ <input type="range" hidden {min} {max} {step} {disabled} {value} bind:this={inputElement} />
257
+ </div>
258
+
259
+ <style lang="scss">
260
+ @use "./Slider";
261
+ </style>
@@ -0,0 +1,62 @@
1
+ .text-block {
2
+ color: currentColor;
3
+ display: inline-block;
4
+ margin: 0;
5
+ padding: 0;
6
+ &.type- {
7
+ &subtitle,
8
+ &title,
9
+ &title-large,
10
+ &display {
11
+ font: {
12
+ family: var(--font-family-display);
13
+ weight: 600;
14
+ }
15
+ }
16
+ &body,
17
+ &body-strong,
18
+ &body-large {
19
+ font-family: var(--font-family-text);
20
+ }
21
+ &caption {
22
+ line-height: 16px;
23
+ font: {
24
+ size: var(--caption-font-size);
25
+ weight: 400;
26
+ family: var(--font-family-small);
27
+ }
28
+ }
29
+ &body,
30
+ &body-strong,
31
+ &body-large {
32
+ line-height: 20px;
33
+ font: {
34
+ weight: 400;
35
+ size: var(--body-font-size);
36
+ }
37
+ }
38
+ &body-strong {
39
+ font-weight: 600;
40
+ }
41
+ &body-large {
42
+ font-size: var(--body-large-font-size);
43
+ line-height: 24px;
44
+ }
45
+ &subtitle {
46
+ font-size: var(--subtitle-font-size);
47
+ line-height: 28px;
48
+ }
49
+ &title {
50
+ font-size: var(--title-font-size);
51
+ line-height: 36px;
52
+ }
53
+ &title-large {
54
+ font-size: var(--title-large-font-size);
55
+ line-height: 52px;
56
+ }
57
+ &display {
58
+ font-size: var(--display-font-size);
59
+ line-height: 92px;
60
+ }
61
+ }
62
+ }
@@ -0,0 +1,70 @@
1
+ <script lang="ts">
2
+ /** Determines which preset text style should be used. */
3
+ export let variant:
4
+ | "caption"
5
+ | "body"
6
+ | "bodyStrong"
7
+ | "bodyLarge"
8
+ | "subtitle"
9
+ | "title"
10
+ | "titleLarge"
11
+ | "display" = "body";
12
+
13
+ /** Overrides the default HTML tag of the block's element with your own tag. */
14
+ export let tag = undefined;
15
+
16
+ /** Specifies a custom class name for the text block */
17
+ let className = "";
18
+ export { className as class };
19
+
20
+ /** Obtains a bound DOM reference to the text's element. */
21
+ export let element: HTMLElement = null;
22
+
23
+ const map = {
24
+ caption: {
25
+ tag: "span",
26
+ name: "caption"
27
+ },
28
+ body: {
29
+ tag: "span",
30
+ name: "body"
31
+ },
32
+ bodyStrong: {
33
+ tag: "h5",
34
+ name: "body-strong"
35
+ },
36
+ bodyLarge: {
37
+ tag: "h5",
38
+ name: "body-large"
39
+ },
40
+ subtitle: {
41
+ tag: "h4",
42
+ name: "subtitle"
43
+ },
44
+ title: {
45
+ tag: "h3",
46
+ name: "title"
47
+ },
48
+ titleLarge: {
49
+ tag: "h2",
50
+ name: "title-large"
51
+ },
52
+ display: {
53
+ tag: "h1",
54
+ name: "display"
55
+ }
56
+ };
57
+ </script>
58
+
59
+ <svelte:element
60
+ this={tag ? tag : map[variant].tag}
61
+ class="text-block type-{map[variant].name} {className}"
62
+ bind:this={element}
63
+ {...$$restProps}
64
+ >
65
+ <slot />
66
+ </svelte:element>
67
+
68
+ <style lang="scss">
69
+ @use "./TextBlock";
70
+ </style>
@@ -0,0 +1,108 @@
1
+ @use "../mixins" as *;
2
+
3
+ .text-box {
4
+ @include typography-body;
5
+ box-sizing: border-box;
6
+ border: none;
7
+ outline: none;
8
+ cursor: unset;
9
+ margin: 0;
10
+ flex: 1 1 auto;
11
+ inline-size: 100%;
12
+ min-block-size: 30px;
13
+ padding-inline: 10px;
14
+ border-radius: var(--control-corner-radius);
15
+ color: var(--text-primary);
16
+ background-color: transparent;
17
+ &::placeholder {
18
+ user-select: none;
19
+ color: var(--text-secondary);
20
+ }
21
+ &::-webkit-search-decoration,
22
+ &::-webkit-search-cancel-button,
23
+ &::-webkit-search-results-button,
24
+ &::-webkit-search-results-decoration {
25
+ -webkit-appearance: none;
26
+ }
27
+ &::-ms-reveal {
28
+ display: none;
29
+ }
30
+ &:disabled {
31
+ color: var(--text-disabled);
32
+
33
+ &::placeholder {
34
+ color: var(--text-disabled);
35
+ }
36
+ }
37
+ &-container {
38
+ @include flex($align: center);
39
+ cursor: text;
40
+ position: relative;
41
+ inline-size: 100%;
42
+ border-radius: var(--control-corner-radius);
43
+ background-clip: padding-box;
44
+ background-color: var(--control-fill-default);
45
+ border: 1px solid var(--control-stroke-default);
46
+ &:hover {
47
+ background-color: var(--control-fill-secondary);
48
+ }
49
+ &.disabled {
50
+ cursor: default;
51
+ background-color: var(--control-fill-disabled);
52
+ .text-box-underline {
53
+ display: none;
54
+ }
55
+ }
56
+ &:focus-within {
57
+ background-color: var(--control-fill-input-active);
58
+ .text-box::placeholder {
59
+ color: var(--text-tertiary);
60
+ }
61
+ .text-box-underline::after {
62
+ border-bottom: 2px solid var(--accent-default);
63
+ }
64
+ :global(.text-box-clear-button) {
65
+ display: flex;
66
+ }
67
+ }
68
+ }
69
+ &-underline {
70
+ position: absolute;
71
+ inset-inline-start: -1px;
72
+ inset-block-start: -1px;
73
+ inline-size: calc(100% + 2px);
74
+ block-size: calc(100% + 2px);
75
+ pointer-events: none;
76
+ border-radius: var(--control-corner-radius);
77
+ overflow: hidden;
78
+ &::after {
79
+ content: "";
80
+ box-sizing: border-box;
81
+ position: absolute;
82
+ inset-block-end: 0;
83
+ inset-inline-start: 0;
84
+ inline-size: 100%;
85
+ block-size: 100%;
86
+ border-bottom: 1px solid var(--control-strong-stroke-default);
87
+ }
88
+ }
89
+ &-buttons {
90
+ @include flex($align: center);
91
+ cursor: default;
92
+ flex: 0 0 auto;
93
+ :global {
94
+ > .text-box-button {
95
+ margin-inline-start: 6px;
96
+ &:first-of-type {
97
+ margin-inline-start: 0;
98
+ }
99
+ &:last-of-type {
100
+ margin-inline-end: 4px;
101
+ }
102
+ }
103
+ .text-box-clear-button {
104
+ display: none;
105
+ }
106
+ }
107
+ }
108
+ }