@sats-group/ui-lib 74.2.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.
- package/.nvmrc +1 -0
- package/README.md +35 -0
- package/catalog-info.yaml +14 -0
- package/eslint.config.mjs +94 -0
- package/fonts/Inter-BoldItalic.woff +0 -0
- package/fonts/Inter-BoldItalic.woff2 +0 -0
- package/fonts/Inter-ExtraBold.woff +0 -0
- package/fonts/Inter-ExtraBold.woff2 +0 -0
- package/fonts/Inter-Italic.woff +0 -0
- package/fonts/Inter-Italic.woff2 +0 -0
- package/fonts/Inter-Regular.woff +0 -0
- package/fonts/Inter-Regular.woff2 +0 -0
- package/fonts/Inter-SemiBold.woff +0 -0
- package/fonts/Inter-SemiBold.woff2 +0 -0
- package/fonts/LICENSE.txt +92 -0
- package/fonts/SATSHeadline-Bold.woff +0 -0
- package/fonts/SATSHeadline-BoldItalic.woff +0 -0
- package/fonts/SATSHeadline-RegularItalic.woff +0 -0
- package/fonts/SATSHeadline-SemiBoldItalic.woff +0 -0
- package/logos/e-avatar.svg +3 -0
- package/logos/elixia-letter.svg +3 -0
- package/logos/elixia-small.svg +8 -0
- package/logos/elixia.svg +8 -0
- package/logos/s-avatar.svg +3 -0
- package/logos/sats-letter.svg +3 -0
- package/logos/sats-small.svg +3 -0
- package/logos/sats.svg +4 -0
- package/package.json +58 -0
- package/react/add-bem-modifiers.ts +51 -0
- package/react/badge/badge.scss +53 -0
- package/react/badge/badge.tsx +28 -0
- package/react/badge/badge.types.ts +34 -0
- package/react/badge/index.ts +2 -0
- package/react/banner/banner.scss +118 -0
- package/react/banner/banner.tsx +92 -0
- package/react/banner/banner.types.ts +10 -0
- package/react/banner/index.ts +2 -0
- package/react/bomb/bomb.scss +33 -0
- package/react/bomb/bomb.tsx +19 -0
- package/react/bomb/bomb.types.ts +1 -0
- package/react/bomb/index.ts +2 -0
- package/react/button/button.tsx +19 -0
- package/react/button/button.types.ts +3 -0
- package/react/button/index.ts +2 -0
- package/react/checkbox/checkbox.scss +218 -0
- package/react/checkbox/checkbox.tsx +176 -0
- package/react/checkbox/checkbox.types.ts +19 -0
- package/react/checkbox/index.ts +2 -0
- package/react/chip/chip.scss +46 -0
- package/react/chip/chip.tsx +37 -0
- package/react/chip/chip.types.ts +18 -0
- package/react/chip/index.ts +2 -0
- package/react/chip/remove.tsx +14 -0
- package/react/chip-selected/chip-selected.scss +47 -0
- package/react/chip-selected/chip-selected.tsx +102 -0
- package/react/chip-selected/chip-selected.types.ts +11 -0
- package/react/chip-selected/index.ts +2 -0
- package/react/confirmation/confirmation.scss +60 -0
- package/react/confirmation/confirmation.tsx +85 -0
- package/react/confirmation/confirmation.types.ts +24 -0
- package/react/confirmation/index.ts +2 -0
- package/react/context-menu/context-menu.scss +183 -0
- package/react/context-menu/context-menu.tsx +200 -0
- package/react/context-menu/context-menu.types.ts +71 -0
- package/react/context-menu/index.ts +2 -0
- package/react/cropped-image/cropped-image.scss +48 -0
- package/react/cropped-image/cropped-image.tsx +36 -0
- package/react/cropped-image/cropped-image.types.ts +26 -0
- package/react/cropped-image/index.ts +2 -0
- package/react/dropdown-list/dropdown-list.scss +170 -0
- package/react/dropdown-list/dropdown-list.tsx +116 -0
- package/react/dropdown-list/dropdown-list.types.ts +17 -0
- package/react/dropdown-list/index.ts +2 -0
- package/react/expander/expander.scss +115 -0
- package/react/expander/expander.tsx +167 -0
- package/react/expander/expander.types.ts +26 -0
- package/react/expander/index.ts +2 -0
- package/react/filter/filter.scss +94 -0
- package/react/filter/filter.tsx +99 -0
- package/react/filter/filter.types.ts +8 -0
- package/react/filter/index.ts +2 -0
- package/react/filter-wrapper/filter-wrapper.scss +46 -0
- package/react/filter-wrapper/filter-wrapper.tsx +24 -0
- package/react/filter-wrapper/filter-wrapper.types.ts +10 -0
- package/react/filter-wrapper/index.ts +2 -0
- package/react/flag/flag.scss +26 -0
- package/react/flag/flag.tsx +27 -0
- package/react/flag/flag.types.ts +17 -0
- package/react/flag/index.ts +2 -0
- package/react/form-content/checkbox-category.tsx +183 -0
- package/react/form-content/form-content.checkbox-list.tsx +126 -0
- package/react/form-content/form-content.checkbox-list.types.ts +36 -0
- package/react/form-content/form-content.radio-list.tsx +58 -0
- package/react/form-content/form-content.range.tsx +20 -0
- package/react/form-content/form-content.range.types.ts +14 -0
- package/react/form-content/form-content.scss +234 -0
- package/react/form-content/form-content.search.tsx +47 -0
- package/react/form-content/form-content.tsx +95 -0
- package/react/form-content/form-content.types.ts +55 -0
- package/react/form-content/index.ts +2 -0
- package/react/form-content/types/index.d.ts +1 -0
- package/react/hidden-input/hidden-input.tsx +9 -0
- package/react/hidden-input/hidden-input.types.ts +6 -0
- package/react/hidden-input/index.ts +2 -0
- package/react/hooks/focus-previous-element.ts +30 -0
- package/react/hooks/is-running-on-client.ts +1 -0
- package/react/hooks/use-click-outside.ts +23 -0
- package/react/hooks/use-escape.ts +18 -0
- package/react/hooks/use-event.ts +29 -0
- package/react/hooks/use-is-mounted.ts +11 -0
- package/react/hooks/use-toggle.ts +19 -0
- package/react/icons/16/close.tsx +12 -0
- package/react/icons/18/close.tsx +18 -0
- package/react/icons/24/arrow-down.tsx +14 -0
- package/react/icons/24/arrow-right.tsx +14 -0
- package/react/icons/24/arrow-up.tsx +14 -0
- package/react/icons/24/close.tsx +12 -0
- package/react/icons/24/remove.tsx +12 -0
- package/react/icons/24/search.tsx +10 -0
- package/react/icons/icons.md +3 -0
- package/react/indexed-access-type.ts +1 -0
- package/react/link/index.ts +2 -0
- package/react/link/link.scss +44 -0
- package/react/link/link.tsx +62 -0
- package/react/link/link.types.ts +37 -0
- package/react/link-button/index.ts +2 -0
- package/react/link-button/link-button.tsx +17 -0
- package/react/link-button/link-button.types.ts +5 -0
- package/react/link-card/index.ts +2 -0
- package/react/link-card/link-card.scss +37 -0
- package/react/link-card/link-card.tsx +24 -0
- package/react/link-card/link-card.types.ts +5 -0
- package/react/logos/e-avatar.tsx +12 -0
- package/react/logos/elixia-letter.tsx +12 -0
- package/react/logos/elixia-small.tsx +12 -0
- package/react/logos/elixia.tsx +12 -0
- package/react/logos/index.ts +8 -0
- package/react/logos/s-avatar.tsx +12 -0
- package/react/logos/sats-letter.tsx +12 -0
- package/react/logos/sats-small.tsx +12 -0
- package/react/logos/sats.tsx +12 -0
- package/react/message/hook/use-message.ts +22 -0
- package/react/message/index.ts +2 -0
- package/react/message/message.scss +92 -0
- package/react/message/message.tsx +60 -0
- package/react/message/message.types.ts +39 -0
- package/react/message/publish.ts +19 -0
- package/react/message-field/index.ts +2 -0
- package/react/message-field/message-field.scss +21 -0
- package/react/message-field/message-field.tsx +70 -0
- package/react/message-field/message-field.types.ts +24 -0
- package/react/modal/index.ts +2 -0
- package/react/modal/modal.scss +162 -0
- package/react/modal/modal.tsx +130 -0
- package/react/modal/modal.types.ts +36 -0
- package/react/modal/tab-trapper.tsx +68 -0
- package/react/progress-bar/index.ts +2 -0
- package/react/progress-bar/progress-bar.scss +71 -0
- package/react/progress-bar/progress-bar.tsx +81 -0
- package/react/progress-bar/progress-bar.types.ts +35 -0
- package/react/radio/index.ts +2 -0
- package/react/radio/radio.scss +142 -0
- package/react/radio/radio.tsx +87 -0
- package/react/radio/radio.types.ts +15 -0
- package/react/scale-bar/index.ts +2 -0
- package/react/scale-bar/scale-bar.scss +22 -0
- package/react/scale-bar/scale-bar.tsx +29 -0
- package/react/scale-bar/scale-bar.types.ts +4 -0
- package/react/search/index.ts +2 -0
- package/react/search/search.scss +207 -0
- package/react/search/search.tsx +255 -0
- package/react/search/search.types.ts +43 -0
- package/react/select/chevron-down.tsx +24 -0
- package/react/select/index.ts +2 -0
- package/react/select/select.scss +135 -0
- package/react/select/select.tsx +105 -0
- package/react/select/select.types.ts +19 -0
- package/react/select-option/README.md +3 -0
- package/react/select-option/index.ts +2 -0
- package/react/select-option/select-option.tsx +16 -0
- package/react/select-option/select-option.types.ts +8 -0
- package/react/tag/index.ts +2 -0
- package/react/tag/tag.scss +107 -0
- package/react/tag/tag.tsx +26 -0
- package/react/tag/tag.types.ts +30 -0
- package/react/text/index.ts +2 -0
- package/react/text/text.scss +109 -0
- package/react/text/text.tsx +40 -0
- package/react/text/text.types.ts +29 -0
- package/react/text-area/index.ts +2 -0
- package/react/text-area/text-area.scss +180 -0
- package/react/text-area/text-area.tsx +153 -0
- package/react/text-area/text-area.types.ts +24 -0
- package/react/text-input/index.ts +2 -0
- package/react/text-input/text-input.scss +233 -0
- package/react/text-input/text-input.tsx +106 -0
- package/react/text-input/text-input.types.ts +19 -0
- package/react/toggle/index.ts +2 -0
- package/react/toggle/toggle.scss +69 -0
- package/react/toggle/toggle.tsx +83 -0
- package/react/toggle/toggle.types.ts +11 -0
- package/react/toolbox/index.ts +2 -0
- package/react/toolbox/toolbox.scss +68 -0
- package/react/toolbox/toolbox.tsx +43 -0
- package/react/toolbox/toolbox.types.ts +39 -0
- package/react/ts/debounce.ts +12 -0
- package/react/types.ts +38 -0
- package/react/use-input-validation.ts +47 -0
- package/react/use-input-validation.types.ts +12 -0
- package/react/visually-button/index.ts +2 -0
- package/react/visually-button/visually-button.scss +470 -0
- package/react/visually-button/visually-button.tsx +130 -0
- package/react/visually-button/visually-button.types.ts +71 -0
- package/react/visually-hidden/index.ts +2 -0
- package/react/visually-hidden/visually-hidden.scss +6 -0
- package/react/visually-hidden/visually-hidden.tsx +10 -0
- package/tokens/corner-radius.scss +5 -0
- package/tokens/dark.scss +392 -0
- package/tokens/darkmode.scss +131 -0
- package/tokens/elevation.scss +57 -0
- package/tokens/font-faces.scss +62 -0
- package/tokens/font-names.scss +2 -0
- package/tokens/font-sizes.scss +95 -0
- package/tokens/light.scss +392 -0
- package/tokens/lightmode.scss +131 -0
- package/tokens/primitives.scss +137 -0
- package/tokens/spacing.scss +12 -0
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
@use '../../tokens/light';
|
|
2
|
+
@use '../../tokens/spacing';
|
|
3
|
+
|
|
4
|
+
.radio {
|
|
5
|
+
$root: &;
|
|
6
|
+
$size: 22px;
|
|
7
|
+
|
|
8
|
+
position: relative;
|
|
9
|
+
display: block;
|
|
10
|
+
|
|
11
|
+
&:focus-within {
|
|
12
|
+
.radio__fake-element {
|
|
13
|
+
outline: 4px solid currentColor;
|
|
14
|
+
outline-offset: 2px;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
&--error {
|
|
19
|
+
// NOTE: When multiple radios have the same name and all are required,
|
|
20
|
+
// ticking one of them will result in the other ones still being
|
|
21
|
+
// visually marked with an input error. The check for `:not(:valid)` fixes that.
|
|
22
|
+
input:not(:valid) ~ #{$root}__label #{$root}__fake-element {
|
|
23
|
+
border-color: light.$ge-signal-border-error;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
input {
|
|
28
|
+
position: absolute;
|
|
29
|
+
top: 0;
|
|
30
|
+
margin: 0;
|
|
31
|
+
opacity: 0;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// NOTE: size these together to ensure the native input
|
|
35
|
+
// is the same size as the fake one
|
|
36
|
+
input,
|
|
37
|
+
&__fake-element {
|
|
38
|
+
height: $size;
|
|
39
|
+
width: $size;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
&--underline {
|
|
43
|
+
display: flex;
|
|
44
|
+
flex-direction: column;
|
|
45
|
+
padding-bottom: spacing.$s;
|
|
46
|
+
border-bottom: 1px solid light.$ge-border-default;
|
|
47
|
+
|
|
48
|
+
&--light {
|
|
49
|
+
border-color: light.$ge-fixed-selector-unselected-default;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
&__fake-element {
|
|
54
|
+
position: relative;
|
|
55
|
+
display: block;
|
|
56
|
+
margin-right: 8px;
|
|
57
|
+
border: 2px solid light.$ge-selector-primary-unselected-default;
|
|
58
|
+
border-radius: 100%;
|
|
59
|
+
box-sizing: border-box;
|
|
60
|
+
flex-shrink: 0;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
&__description {
|
|
64
|
+
margin-top: spacing.$xxs;
|
|
65
|
+
margin-left: 31px;
|
|
66
|
+
color: light.$on-surface-primary-alternate;
|
|
67
|
+
|
|
68
|
+
&--light {
|
|
69
|
+
color: light.$on-fixed-surface-primary-alternate;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
input:disabled ~ .radio__label {
|
|
74
|
+
color: light.$on-surface-primary-disabled;
|
|
75
|
+
|
|
76
|
+
.radio__fake-element {
|
|
77
|
+
border-color: light.$ge-selector-primary-unselected-disabled;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
input:disabled ~ .radio__description {
|
|
82
|
+
color: light.$on-surface-primary-disabled;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
input:checked ~ &__label &__fake-element {
|
|
86
|
+
border-color: light.$ge-selector-primary-selected-default;
|
|
87
|
+
|
|
88
|
+
&:before {
|
|
89
|
+
content: '';
|
|
90
|
+
position: absolute;
|
|
91
|
+
top: 50%;
|
|
92
|
+
left: 50%;
|
|
93
|
+
background-color: light.$ge-selector-primary-selected-default;
|
|
94
|
+
height: 14px;
|
|
95
|
+
width: 14px;
|
|
96
|
+
border-radius: 100%;
|
|
97
|
+
transform: translate(-50%, -50%);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
&__label {
|
|
102
|
+
display: inline-flex;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
&--light {
|
|
106
|
+
.radio__fake-element {
|
|
107
|
+
border-color: light.$ge-fixed-selector-unselected-default;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.radio__label {
|
|
111
|
+
color: light.$on-fixed-surface-primary-default;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.radio__description {
|
|
115
|
+
color: light.$on-fixed-surface-primary-alternate;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
& input:disabled ~ .radio__label {
|
|
119
|
+
color: light.$on-fixed-surface-primary-disabled;
|
|
120
|
+
|
|
121
|
+
.radio__fake-element {
|
|
122
|
+
border-color: light.$ge-fixed-selector-unselected-disabled;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
& input:disabled ~ .radio__description {
|
|
127
|
+
color: light.$on-fixed-surface-primary-disabled;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
// NOTE: When multiple radios have the same name and all are required,
|
|
132
|
+
// ticking one of them will result in the other ones still being
|
|
133
|
+
// visually marked with an input error. This fixes that.
|
|
134
|
+
input:valid ~ &__error {
|
|
135
|
+
display: none;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
&__error {
|
|
139
|
+
color: light.$on-surface-error;
|
|
140
|
+
margin-top: spacing.$xxs;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import cn from 'classnames';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
|
|
4
|
+
import useInputValidation from '../use-input-validation';
|
|
5
|
+
import Text from '../text';
|
|
6
|
+
|
|
7
|
+
import { colors, Radio as Props } from './radio.types';
|
|
8
|
+
|
|
9
|
+
const RefRadio = React.forwardRef<
|
|
10
|
+
HTMLInputElement,
|
|
11
|
+
React.PropsWithChildren<Props>
|
|
12
|
+
>(
|
|
13
|
+
(
|
|
14
|
+
{
|
|
15
|
+
children,
|
|
16
|
+
color,
|
|
17
|
+
description,
|
|
18
|
+
isUnderline,
|
|
19
|
+
label,
|
|
20
|
+
name,
|
|
21
|
+
showCustomError = true,
|
|
22
|
+
value,
|
|
23
|
+
...restProps
|
|
24
|
+
},
|
|
25
|
+
ref,
|
|
26
|
+
) => {
|
|
27
|
+
const [onChange, onInvalid, error] = useInputValidation();
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<label
|
|
31
|
+
className={cn(
|
|
32
|
+
'radio',
|
|
33
|
+
{ 'radio--error': error, 'radio--underline': isUnderline },
|
|
34
|
+
color,
|
|
35
|
+
)}
|
|
36
|
+
>
|
|
37
|
+
<input
|
|
38
|
+
name={name}
|
|
39
|
+
value={value}
|
|
40
|
+
ref={ref}
|
|
41
|
+
type="radio"
|
|
42
|
+
onChange={e => {
|
|
43
|
+
// NOTE: To not break compatibility
|
|
44
|
+
if (restProps.onChange) restProps.onChange(e);
|
|
45
|
+
onChange(e);
|
|
46
|
+
}}
|
|
47
|
+
onInvalid={e => {
|
|
48
|
+
// NOTE: To not break compatibility
|
|
49
|
+
if (restProps.onInvalid) restProps.onInvalid(e);
|
|
50
|
+
onInvalid(e);
|
|
51
|
+
}}
|
|
52
|
+
{...restProps}
|
|
53
|
+
/>
|
|
54
|
+
<div className="radio__label">
|
|
55
|
+
<span className="radio__fake-element"></span>
|
|
56
|
+
<span>
|
|
57
|
+
{label}
|
|
58
|
+
{children}
|
|
59
|
+
</span>
|
|
60
|
+
</div>
|
|
61
|
+
|
|
62
|
+
{/* NOTE: This is aria-hidden because reporting of validation errors is handled by the browser */}
|
|
63
|
+
{error && showCustomError && (
|
|
64
|
+
<div aria-hidden="true" className="radio__error">
|
|
65
|
+
{error}
|
|
66
|
+
</div>
|
|
67
|
+
)}
|
|
68
|
+
|
|
69
|
+
{description && (
|
|
70
|
+
<Text className="radio__description" size={Text.sizes.small}>
|
|
71
|
+
{description}
|
|
72
|
+
</Text>
|
|
73
|
+
)}
|
|
74
|
+
</label>
|
|
75
|
+
);
|
|
76
|
+
},
|
|
77
|
+
);
|
|
78
|
+
|
|
79
|
+
// NOTE: If this isn't set, stack traces say "forwardRef" instead of "Radio"
|
|
80
|
+
RefRadio.displayName = 'Radio';
|
|
81
|
+
|
|
82
|
+
// NOTE: The component is redeclared here because TypeScript doesn't accept assigning extra properties to `RefComponent` when it's declared
|
|
83
|
+
const Radio: typeof RefRadio & {
|
|
84
|
+
colors: typeof colors;
|
|
85
|
+
} = Object.assign(RefRadio, { colors });
|
|
86
|
+
|
|
87
|
+
export default Radio;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { InputHtmlProps, ObjectValues } from '../types';
|
|
2
|
+
|
|
3
|
+
export const colors = {
|
|
4
|
+
light: 'radio--light',
|
|
5
|
+
} as const;
|
|
6
|
+
|
|
7
|
+
export type Radio = {
|
|
8
|
+
color?: ObjectValues<typeof colors>;
|
|
9
|
+
description?: string;
|
|
10
|
+
isUnderline?: boolean;
|
|
11
|
+
label?: string;
|
|
12
|
+
name: string;
|
|
13
|
+
showCustomError?: boolean;
|
|
14
|
+
value: string;
|
|
15
|
+
} & InputHtmlProps;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
@use '../../tokens/light';
|
|
2
|
+
|
|
3
|
+
.scale-bar {
|
|
4
|
+
align-items: stretch;
|
|
5
|
+
border-radius: 4px;
|
|
6
|
+
display: flex;
|
|
7
|
+
gap: 2px;
|
|
8
|
+
overflow: hidden;
|
|
9
|
+
height: 8px;
|
|
10
|
+
|
|
11
|
+
&__item {
|
|
12
|
+
flex: 1 1 100%;
|
|
13
|
+
|
|
14
|
+
&--empty {
|
|
15
|
+
background: light.$ge-progress-bar-background;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
&--filled {
|
|
19
|
+
background: light.$ge-progress-bar-indicator-default;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
import VisuallyHidden from '../visually-hidden/visually-hidden';
|
|
4
|
+
|
|
5
|
+
import { ScaleBar as Props } from './scale-bar.types';
|
|
6
|
+
|
|
7
|
+
const ScaleBar: React.FunctionComponent<Props> = ({ max = 4, value }) => (
|
|
8
|
+
<>
|
|
9
|
+
<div className="scale-bar">
|
|
10
|
+
{Array(max)
|
|
11
|
+
.fill(0)
|
|
12
|
+
.map((_, i) => (
|
|
13
|
+
<div
|
|
14
|
+
className={`scale-bar__item scale-bar__item--${
|
|
15
|
+
i < value ? 'filled' : 'empty'
|
|
16
|
+
}`}
|
|
17
|
+
key={i}
|
|
18
|
+
/>
|
|
19
|
+
))}
|
|
20
|
+
</div>
|
|
21
|
+
<VisuallyHidden>
|
|
22
|
+
<meter max={max} min={0} value={value}>
|
|
23
|
+
{value}/{max}
|
|
24
|
+
</meter>
|
|
25
|
+
</VisuallyHidden>
|
|
26
|
+
</>
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
export default ScaleBar;
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
@use '../../tokens/corner-radius';
|
|
2
|
+
@use '../../tokens/font-names';
|
|
3
|
+
@use '../../tokens/font-sizes';
|
|
4
|
+
@use '../../tokens/light';
|
|
5
|
+
@use '../../tokens/spacing';
|
|
6
|
+
@use '../../tokens/elevation';
|
|
7
|
+
|
|
8
|
+
.search {
|
|
9
|
+
$breakpoint: 820px;
|
|
10
|
+
$breakpointSmall: 500px;
|
|
11
|
+
width: 100%;
|
|
12
|
+
display: flex;
|
|
13
|
+
justify-content: flex-end;
|
|
14
|
+
|
|
15
|
+
&--expand-direction-left {
|
|
16
|
+
justify-content: flex-start;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
&__inner,
|
|
20
|
+
&__loading-inner {
|
|
21
|
+
display: flex;
|
|
22
|
+
flex-direction: column;
|
|
23
|
+
gap: spacing.$xs;
|
|
24
|
+
width: 100%;
|
|
25
|
+
transition: max-width 0.3s ease-in;
|
|
26
|
+
|
|
27
|
+
&--expandable {
|
|
28
|
+
@media (min-width: ($breakpointSmall)) {
|
|
29
|
+
max-width: 300px;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
&--expand {
|
|
34
|
+
max-width: 100%;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
&__loading-input {
|
|
39
|
+
background-color: light.$ge-skeleton-default;
|
|
40
|
+
border-radius: spacing.$m;
|
|
41
|
+
|
|
42
|
+
&--fixed {
|
|
43
|
+
background-color: light.$on-fixed-background-primary-disabled;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
&--small {
|
|
47
|
+
height: 46px;
|
|
48
|
+
}
|
|
49
|
+
&--large {
|
|
50
|
+
height: 65px;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
&__loading-extra {
|
|
55
|
+
border-radius: corner-radius.$s;
|
|
56
|
+
color: light.$ge-skeleton-default;
|
|
57
|
+
background-color: light.$ge-skeleton-default;
|
|
58
|
+
width: fit-content;
|
|
59
|
+
|
|
60
|
+
&--fixed {
|
|
61
|
+
background-color: light.$on-fixed-background-primary-disabled;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
&__header {
|
|
66
|
+
&--variant-fixed {
|
|
67
|
+
color: light.$on-fixed-surface-secondary-default;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
&__input-wrapper {
|
|
72
|
+
display: flex;
|
|
73
|
+
justify-content: space-evenly;
|
|
74
|
+
border: 1px solid light.$ge-border-default;
|
|
75
|
+
|
|
76
|
+
&--variant-default {
|
|
77
|
+
background-color: light.$surface-primary-default;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
&--variant-fixed {
|
|
81
|
+
color: light.$on-fixed-surface-secondary-default;
|
|
82
|
+
background-color: light.$fixed-surface-secondary-default;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
&--theme-floating {
|
|
86
|
+
@include elevation.level(2);
|
|
87
|
+
|
|
88
|
+
&:focus-within {
|
|
89
|
+
@include elevation.level(4);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
&--theme-inline {
|
|
94
|
+
&:focus-within {
|
|
95
|
+
border-color: light.$ge-border-focused;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
&--size-large {
|
|
100
|
+
height: 65px;
|
|
101
|
+
padding: 0 spacing.$m;
|
|
102
|
+
gap: spacing.$m;
|
|
103
|
+
border-radius: corner-radius.$m;
|
|
104
|
+
|
|
105
|
+
@media (max-width: ($breakpoint)) {
|
|
106
|
+
height: 50px;
|
|
107
|
+
gap: spacing.$xxs;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
&--size-small {
|
|
112
|
+
height: 46px;
|
|
113
|
+
padding: 0 spacing.$s;
|
|
114
|
+
gap: spacing.$s;
|
|
115
|
+
border-radius: corner-radius.$s;
|
|
116
|
+
|
|
117
|
+
@media (max-width: ($breakpoint)) {
|
|
118
|
+
height: 40px;
|
|
119
|
+
gap: spacing.$xxs;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
> * + * {
|
|
124
|
+
flex-shrink: 0;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
&__label {
|
|
129
|
+
display: flex;
|
|
130
|
+
justify-content: space-evenly;
|
|
131
|
+
align-items: center;
|
|
132
|
+
gap: spacing.$s;
|
|
133
|
+
width: 100%;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
&__input {
|
|
137
|
+
border: none;
|
|
138
|
+
background: none;
|
|
139
|
+
color: inherit;
|
|
140
|
+
flex: 1;
|
|
141
|
+
width: 100%;
|
|
142
|
+
height: 100%;
|
|
143
|
+
overflow: hidden;
|
|
144
|
+
text-overflow: ellipsis;
|
|
145
|
+
white-space: nowrap;
|
|
146
|
+
|
|
147
|
+
&::-webkit-search-cancel-button {
|
|
148
|
+
display: none;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
&--size-small {
|
|
152
|
+
@include font-sizes.normal(small)
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
&--size-large {
|
|
156
|
+
@include font-sizes.normal(large)
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
&--variant-fixed {
|
|
160
|
+
&::placeholder {
|
|
161
|
+
color: light.$on-fixed-surface-secondary-alternate;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
&:focus {
|
|
166
|
+
outline: none;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
&__icon {
|
|
171
|
+
display: flex;
|
|
172
|
+
background: transparent;
|
|
173
|
+
color: light.$on-surface-primary-alternate;
|
|
174
|
+
|
|
175
|
+
&--variant-fixed {
|
|
176
|
+
color: light.$on-fixed-surface-secondary-alternate;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
&__clear-button {
|
|
181
|
+
align-self: center;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
&__close-button,
|
|
185
|
+
&__search-button {
|
|
186
|
+
align-self: center;
|
|
187
|
+
|
|
188
|
+
@media (max-width: ($breakpoint)) {
|
|
189
|
+
display: none !important;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
&__error {
|
|
194
|
+
margin-top: spacing.$xxs;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
&__help-text {
|
|
198
|
+
display: flex;
|
|
199
|
+
gap: spacing.$xs;
|
|
200
|
+
align-items: center;
|
|
201
|
+
color: light.$on-background-primary-disabled;
|
|
202
|
+
|
|
203
|
+
&--variant-fixed {
|
|
204
|
+
color: light.$on-fixed-background-primary-disabled;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|