@sebgroup/green-core 3.31.0 → 3.32.1
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/components/dropdown/dropdown.component.d.ts +1 -0
- package/components/dropdown/dropdown.component.js +23 -4
- package/components/form-summary/summary.component.d.ts +3 -0
- package/components/form-summary/summary.component.js +17 -16
- package/custom-elements.json +11806 -11785
- package/gds-element.js +1 -1
- package/generated/locales/da.d.ts +5 -0
- package/generated/locales/da.js +5 -0
- package/generated/locales/de.d.ts +5 -0
- package/generated/locales/de.js +5 -0
- package/generated/locales/fi.d.ts +5 -0
- package/generated/locales/fi.js +5 -0
- package/generated/locales/fr.d.ts +5 -0
- package/generated/locales/fr.js +5 -0
- package/generated/locales/it.d.ts +5 -0
- package/generated/locales/it.js +5 -0
- package/generated/locales/nl.d.ts +5 -0
- package/generated/locales/nl.js +5 -0
- package/generated/locales/no.d.ts +5 -0
- package/generated/locales/no.js +5 -0
- package/generated/locales/sv.d.ts +5 -0
- package/generated/locales/sv.js +5 -0
- package/generated/mcp/alert/guidelines.md +105 -0
- package/generated/mcp/alert/index.json +1 -0
- package/generated/mcp/avatar/guidelines.md +40 -0
- package/generated/mcp/avatar/index.json +1 -0
- package/generated/mcp/badge/guidelines.md +56 -0
- package/generated/mcp/badge/index.json +1 -0
- package/generated/mcp/blur/guidelines.md +3 -0
- package/generated/mcp/blur/index.json +1 -0
- package/generated/mcp/breadcrumbs/guidelines.md +35 -0
- package/generated/mcp/breadcrumbs/index.json +1 -0
- package/generated/mcp/button/guidelines.md +83 -0
- package/generated/mcp/button/index.json +1 -0
- package/generated/mcp/calendar/guidelines.md +3 -0
- package/generated/mcp/calendar/index.json +1 -0
- package/generated/mcp/card/guidelines.md +78 -0
- package/generated/mcp/card/index.json +1 -0
- package/generated/mcp/card-pattern-01/guidelines.md +52 -0
- package/generated/mcp/card-pattern-01/index.json +1 -0
- package/generated/mcp/checkbox/guidelines.md +91 -0
- package/generated/mcp/checkbox/index.json +1 -0
- package/generated/mcp/coachmark/guidelines.md +8 -0
- package/generated/mcp/coachmark/index.json +1 -0
- package/generated/mcp/components.json +47 -1
- package/generated/mcp/context-menu/guidelines.md +33 -0
- package/generated/mcp/context-menu/index.json +1 -0
- package/generated/mcp/datepicker/guidelines.md +44 -0
- package/generated/mcp/datepicker/index.json +1 -0
- package/generated/mcp/details/guidelines.md +24 -0
- package/generated/mcp/details/index.json +1 -0
- package/generated/mcp/dialog/guidelines.md +35 -0
- package/generated/mcp/dialog/index.json +1 -0
- package/generated/mcp/div/guidelines.md +3 -0
- package/generated/mcp/div/index.json +1 -0
- package/generated/mcp/divider/guidelines.md +24 -0
- package/generated/mcp/divider/index.json +1 -0
- package/generated/mcp/dropdown/guidelines.md +96 -0
- package/generated/mcp/dropdown/index.json +1 -0
- package/generated/mcp/fab/guidelines.md +27 -0
- package/generated/mcp/fab/index.json +1 -0
- package/generated/mcp/filter-chips/guidelines.md +47 -0
- package/generated/mcp/filter-chips/index.json +1 -0
- package/generated/mcp/flex/guidelines.md +1 -0
- package/generated/mcp/flex/index.json +1 -0
- package/generated/mcp/form-summary/angular.md +8 -0
- package/generated/mcp/form-summary/api.md +7 -0
- package/generated/mcp/form-summary/guidelines.md +39 -0
- package/generated/mcp/form-summary/index.json +1 -0
- package/generated/mcp/form-summary/react.md +8 -0
- package/generated/mcp/grid/guidelines.md +3 -0
- package/generated/mcp/grid/index.json +1 -0
- package/generated/mcp/icons.json +1 -1
- package/generated/mcp/index.json +1 -1
- package/generated/mcp/input/guidelines.md +127 -0
- package/generated/mcp/input/index.json +1 -0
- package/generated/mcp/link/guidelines.md +43 -0
- package/generated/mcp/link/index.json +1 -0
- package/generated/mcp/list/guidelines.md +16 -0
- package/generated/mcp/list/index.json +1 -0
- package/generated/mcp/list-item-pattern-01/guidelines.md +49 -0
- package/generated/mcp/list-item-pattern-01/index.json +1 -0
- package/generated/mcp/menu-button/guidelines.md +39 -0
- package/generated/mcp/menu-button/index.json +1 -0
- package/generated/mcp/pagination/guidelines.md +24 -0
- package/generated/mcp/pagination/index.json +1 -0
- package/generated/mcp/popover/guidelines.md +3 -0
- package/generated/mcp/popover/index.json +1 -0
- package/generated/mcp/progress/guidelines.md +42 -0
- package/generated/mcp/progress/index.json +1 -0
- package/generated/mcp/radio/guidelines.md +74 -0
- package/generated/mcp/radio/index.json +1 -0
- package/generated/mcp/rich-text/guidelines.md +3 -0
- package/generated/mcp/rich-text/index.json +1 -0
- package/generated/mcp/segmented-control/guidelines.md +31 -0
- package/generated/mcp/segmented-control/index.json +1 -0
- package/generated/mcp/select/guidelines.md +29 -0
- package/generated/mcp/select/index.json +1 -0
- package/generated/mcp/signal/guidelines.md +14 -0
- package/generated/mcp/signal/index.json +1 -0
- package/generated/mcp/slider/guidelines.md +86 -0
- package/generated/mcp/slider/index.json +1 -0
- package/generated/mcp/spinner/guidelines.md +6 -0
- package/generated/mcp/spinner/index.json +1 -0
- package/generated/mcp/switch/guidelines.md +41 -0
- package/generated/mcp/switch/index.json +1 -0
- package/generated/mcp/table/guidelines.md +169 -0
- package/generated/mcp/table/index.json +1 -0
- package/generated/mcp/tabs/guidelines.md +64 -0
- package/generated/mcp/tabs/index.json +1 -0
- package/generated/mcp/text/guidelines.md +3 -0
- package/generated/mcp/text/index.json +1 -0
- package/generated/mcp/textarea/guidelines.md +73 -0
- package/generated/mcp/textarea/index.json +1 -0
- package/generated/mcp/theme/guidelines.md +3 -0
- package/generated/mcp/theme/index.json +1 -0
- package/generated/mcp/tokens.json +1 -1
- package/generated/mcp/tooltip/guidelines.md +107 -0
- package/generated/mcp/tooltip/index.json +1 -0
- package/generated/mcp/video/guidelines.md +3 -0
- package/generated/mcp/video/index.json +1 -0
- package/generated/react/form-summary/index.d.ts +6 -1
- package/generated/react/index.d.ts +4 -4
- package/generated/react/index.js +4 -4
- package/package.json +1 -1
- package/utils/helpers/custom-element-scoping.js +1 -1
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# Textarea
|
|
2
|
+
|
|
3
|
+
Textarea allow users to input text and digits on multiple lines.
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## Overview
|
|
7
|
+
|
|
8
|
+
### Variants
|
|
9
|
+
|
|
10
|
+
We provide two versions of textarea.
|
|
11
|
+
|
|
12
|
+
- **Default**
|
|
13
|
+
- **Floating label** (coming soon): Can only be used in specific contexts. Limited features due to accessibility.
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
#### Label
|
|
20
|
+
|
|
21
|
+
All input fields must have a label to ensure clarity and accessibility. Labels help users understand the purpose of the field, including those using assistive technologies.
|
|
22
|
+
|
|
23
|
+
#### Optional field indicator
|
|
24
|
+
|
|
25
|
+
We only ask for required information. If some fields are optional, we let users know by adding "(optional)" in brackets next to the field label. The word "(optional)" is shown in regular font weight to distinguish it from the label.
|
|
26
|
+
|
|
27
|
+
#### Support text
|
|
28
|
+
|
|
29
|
+
Use this to explain how to fill in the field, for example how to count or what to include.
|
|
30
|
+
|
|
31
|
+
### Contextual help
|
|
32
|
+
|
|
33
|
+
If the label and support text aren’t enough to explain a field, we can use the info icon. Clicking the icon shows additional support text between the label support and the field.
|
|
34
|
+
|
|
35
|
+
- Use a tooltip if space is limited.
|
|
36
|
+
- Use a modal for large amounts of text.
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
#### Leading icon
|
|
41
|
+
|
|
42
|
+
A leading icon visually reinforces the purpose of the field, helping users to understand what type of information is needed.
|
|
43
|
+
|
|
44
|
+
#### Clearable
|
|
45
|
+
|
|
46
|
+
To make it easy for users to clear a field, an x-icon button can be placed at the end of the field. This is commonly used in search/filter forms.
|
|
47
|
+
|
|
48
|
+
#### Error message
|
|
49
|
+
|
|
50
|
+
Used to indicate that a selection must be made from the dropdown or that there is an error with the selected option.
|
|
51
|
+
|
|
52
|
+
### Character counter
|
|
53
|
+
|
|
54
|
+
For fields with a character limit, a counter can be added to show users how many characters they have left.
|
|
55
|
+
|
|
56
|
+
The counter starts with the maximum allowed characters. As the user types, the remaining characters decrease. When the limit is nearly reached, the counter turns yellow. When or if the user exceeds the limit, the counter turns red.
|
|
57
|
+
|
|
58
|
+
If the user ignores this and attempts to submit, an error message will appear indicating that the maximum character limit has been reached.
|
|
59
|
+
|
|
60
|
+
### Resize
|
|
61
|
+
|
|
62
|
+
The default Textarea has a fixed height based on the expected input. This helps users understand how much text the field is intended for. If the field should be resizable, there are two options:
|
|
63
|
+
|
|
64
|
+
- **Automatic**: Adjusts dynamically as the user types.
|
|
65
|
+
- **Manual**: Users can resize it by dragging the corner.
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
### Read only
|
|
70
|
+
|
|
71
|
+
The read only state displays the entered value together with its label. Have no visual cues associated with text entry, such as an active input cursor or editable states. Long content should remain readable and should not be unnecessarily truncated.
|
|
72
|
+
|
|
73
|
+
[Read more about the read only pattern](https://seb.io/pattern/read-only)
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# Tooltip
|
|
2
|
+
|
|
3
|
+
A tooltip provides short, supplementary information about an element on hover or focus.
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## Overview
|
|
7
|
+
|
|
8
|
+
### When to use
|
|
9
|
+
|
|
10
|
+
Tooltips should help users understand an unfamiliar element or provide additional context without interrupting the task. A common use case is an icon-only button where the tooltip describes the action, for example “Download”, “Copy” or “More options”. If the information is important enough that users should always see it, display it directly in the interface instead.
|
|
11
|
+
|
|
12
|
+
#### Use a tooltip when
|
|
13
|
+
|
|
14
|
+
- An icon or control may not be immediately understood without a label.
|
|
15
|
+
- A short explanation can clarify the meaning or purpose of an element.
|
|
16
|
+
- The information is helpful but not essential for completing the task.
|
|
17
|
+
- Additional context would otherwise add unnecessary visual clutter to the interface.
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
#### Avoid using a tooltip for:
|
|
22
|
+
|
|
23
|
+
- information users need in order to understand or complete a task. (essential instructions).
|
|
24
|
+
- validation error messages.
|
|
25
|
+
- important warnings or status information
|
|
26
|
+
- information that users need to compare or reference.
|
|
27
|
+
- repeating text that is already visible in the interface.
|
|
28
|
+
- long information texts.
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
### Behaviour
|
|
33
|
+
|
|
34
|
+
#### A tooltip appears when the associated element receives:
|
|
35
|
+
|
|
36
|
+
- Pointer hover.
|
|
37
|
+
- Keyboard focus.
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
#### The tooltip should disappear when:
|
|
42
|
+
|
|
43
|
+
- The pointer leaves the trigger.
|
|
44
|
+
- Focus moves away from the trigger.
|
|
45
|
+
- The user presses Esc.
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
#### Delay
|
|
50
|
+
|
|
51
|
+
Use a short delay before showing a tooltip on hover to prevent tooltips from appearing while users simply move the pointer across the interface.
|
|
52
|
+
For keyboard focus, the tooltip should appear without creating unnecessary delay in the interaction.
|
|
53
|
+
|
|
54
|
+
### Placement
|
|
55
|
+
|
|
56
|
+
The tooltip should appear close to its trigger without covering the trigger itself. Preferred placement can be determined by the component, but the tooltip should automatically change position when there is not enough available space. Placement should adapt to the viewport rather than causing the tooltip to be clipped or extend outside the visible area.
|
|
57
|
+
|
|
58
|
+
#### Typical placements are:
|
|
59
|
+
|
|
60
|
+
- Top
|
|
61
|
+
- Bottom
|
|
62
|
+
- Left
|
|
63
|
+
- Right
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
### Variants
|
|
68
|
+
|
|
69
|
+
Tooltips are available with or without a pointer. Use a pointer when the tooltip needs to be clearly associated with a larger area or element. For smaller elements, such as icon buttons, a pointer is often unnecessary as the connection is already clear. Both variants can be used depending on the context and placement.
|
|
70
|
+
|
|
71
|
+
### Accessibility
|
|
72
|
+
|
|
73
|
+
Tooltips is available to both pointer and keyboard users. The trigger is focusable when it is an interactive element, and the tooltip is displayed when the trigger receives keyboard focus. The tooltip is programmatically associated with its trigger so assistive technologies can access the same information.
|
|
74
|
+
|
|
75
|
+
#### Tooltip vs accessible name
|
|
76
|
+
|
|
77
|
+
A tooltip does not automatically replace an accessible name.
|
|
78
|
+
For example, an icon-only button still needs an accessible name such as “Download statement”, regardless of whether the same text is visually presented in a tooltip. Avoid using a tooltip as the only way of making an otherwise inaccessible control understandable.
|
|
79
|
+
|
|
80
|
+
#### Touch devices
|
|
81
|
+
|
|
82
|
+
Tooltips should not contain information that is only available through hover, since hover is not reliably available on touch devices.
|
|
83
|
+
If information is important for mobile users, consider displaying it directly in the interface or using another pattern designed for explicit interaction. Do not make essential functionality dependent on a tooltip.
|
|
84
|
+
|
|
85
|
+
### Tooltip vs popover
|
|
86
|
+
|
|
87
|
+
Use a tooltip for short, supplementary, non-interactive information.
|
|
88
|
+
|
|
89
|
+
Use a popover when the content:
|
|
90
|
+
|
|
91
|
+
- Requires user interaction.
|
|
92
|
+
- Contains links, buttons or other controls.
|
|
93
|
+
- Contains more extensive information.
|
|
94
|
+
- Needs to remain open while the user interacts with it.
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
#### A useful rule of thumb
|
|
99
|
+
|
|
100
|
+
Tooltip = short information only.
|
|
101
|
+
|
|
102
|
+
Popover = information and interaction.
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
## UX Guidelines
|
|
106
|
+
|
|
107
|
+
### Writing UX text for tooltip
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { GdsFormSummary as GdsFormSummaryClass } from '../../../components/form-summary/summary.component';
|
|
2
2
|
import { getReactComponent } from '../../../utils/react';
|
|
3
|
+
type GdsFormSummaryProps = React.ComponentProps<ReturnType<typeof getReactComponent<GdsFormSummaryClass>>> & {
|
|
4
|
+
/** Fired when an item in the summary is clicked, before focus moves to the related control. The detail object contains the control. Can be cancelled with event.preventDefault() to handle focus yourself. */
|
|
5
|
+
onGdsControlFocus?: (event: CustomEvent<any>) => void;
|
|
6
|
+
};
|
|
3
7
|
export declare const GdsFormSummary: {
|
|
4
|
-
(props:
|
|
8
|
+
(props: GdsFormSummaryProps & {
|
|
5
9
|
ref?: React.Ref<GdsFormSummaryClass>;
|
|
6
10
|
}): import("react").ReactElement<Omit<Omit<{
|
|
7
11
|
hideErrors?: boolean;
|
|
@@ -676,3 +680,4 @@ export declare const GdsFormSummary: {
|
|
|
676
680
|
} & import("react").RefAttributes<HTMLElement>, string | import("react").JSXElementConstructor<any>>;
|
|
677
681
|
displayName: string;
|
|
678
682
|
};
|
|
683
|
+
export {};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
export * from './alert/index.js';
|
|
2
2
|
export * from './avatar/index.js';
|
|
3
|
-
export * from './blur/index.js';
|
|
4
3
|
export * from './badge/index.js';
|
|
4
|
+
export * from './blur/index.js';
|
|
5
5
|
export * from './breadcrumbs/index.js';
|
|
6
6
|
export * from './button/index.js';
|
|
7
7
|
export * from './calendar/index.js';
|
|
8
8
|
export * from './card/index.js';
|
|
9
|
-
export * from './card-linked/index.js';
|
|
10
9
|
export * from './checkbox/index.js';
|
|
11
10
|
export * from './coachmark/index.js';
|
|
11
|
+
export * from './card-linked/index.js';
|
|
12
12
|
export * from './context-menu/index.js';
|
|
13
13
|
export * from './datepicker/index.js';
|
|
14
14
|
export * from './details/index.js';
|
|
@@ -45,9 +45,9 @@ export * from './table/index.js';
|
|
|
45
45
|
export * from './tabs/index.js';
|
|
46
46
|
export * from './text/index.js';
|
|
47
47
|
export * from './textarea/index.js';
|
|
48
|
+
export * from './theme/index.js';
|
|
48
49
|
export * from './tooltip/index.js';
|
|
49
50
|
export * from './video/index.js';
|
|
50
|
-
export * from './theme/index.js';
|
|
51
51
|
export * from './card-pattern-01/index.js';
|
|
52
52
|
export * from './list-item-pattern-01/index.js';
|
|
53
53
|
export * from './avatar-group/index.js';
|
|
@@ -65,7 +65,6 @@ export * from './sensitive-account/index.js';
|
|
|
65
65
|
export * from './sensitive-date/index.js';
|
|
66
66
|
export * from './sensitive-number/index.js';
|
|
67
67
|
export * from './tab/index.js';
|
|
68
|
-
export * from './tab-panel/index.js';
|
|
69
68
|
export * from './icons/icon-ai/index.js';
|
|
70
69
|
export * from './icons/icon-airplane-up/index.js';
|
|
71
70
|
export * from './icons/icon-archive/index.js';
|
|
@@ -378,5 +377,6 @@ export * from './icons/icon-youtube/index.js';
|
|
|
378
377
|
export * from './icons/icon-zap/index.js';
|
|
379
378
|
export * from './icons/icon-zoom-in/index.js';
|
|
380
379
|
export * from './icons/icon-zoom-out/index.js';
|
|
380
|
+
export * from './tab-panel/index.js';
|
|
381
381
|
export * from './menu-item/index.js';
|
|
382
382
|
export * from './menu-heading/index.js';
|
package/generated/react/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
export * from "./alert/index.js";
|
|
2
2
|
export * from "./avatar/index.js";
|
|
3
|
-
export * from "./blur/index.js";
|
|
4
3
|
export * from "./badge/index.js";
|
|
4
|
+
export * from "./blur/index.js";
|
|
5
5
|
export * from "./breadcrumbs/index.js";
|
|
6
6
|
export * from "./button/index.js";
|
|
7
7
|
export * from "./calendar/index.js";
|
|
8
8
|
export * from "./card/index.js";
|
|
9
|
-
export * from "./card-linked/index.js";
|
|
10
9
|
export * from "./checkbox/index.js";
|
|
11
10
|
export * from "./coachmark/index.js";
|
|
11
|
+
export * from "./card-linked/index.js";
|
|
12
12
|
export * from "./context-menu/index.js";
|
|
13
13
|
export * from "./datepicker/index.js";
|
|
14
14
|
export * from "./details/index.js";
|
|
@@ -45,9 +45,9 @@ export * from "./table/index.js";
|
|
|
45
45
|
export * from "./tabs/index.js";
|
|
46
46
|
export * from "./text/index.js";
|
|
47
47
|
export * from "./textarea/index.js";
|
|
48
|
+
export * from "./theme/index.js";
|
|
48
49
|
export * from "./tooltip/index.js";
|
|
49
50
|
export * from "./video/index.js";
|
|
50
|
-
export * from "./theme/index.js";
|
|
51
51
|
export * from "./card-pattern-01/index.js";
|
|
52
52
|
export * from "./list-item-pattern-01/index.js";
|
|
53
53
|
export * from "./avatar-group/index.js";
|
|
@@ -65,7 +65,6 @@ export * from "./sensitive-account/index.js";
|
|
|
65
65
|
export * from "./sensitive-date/index.js";
|
|
66
66
|
export * from "./sensitive-number/index.js";
|
|
67
67
|
export * from "./tab/index.js";
|
|
68
|
-
export * from "./tab-panel/index.js";
|
|
69
68
|
export * from "./icons/icon-ai/index.js";
|
|
70
69
|
export * from "./icons/icon-airplane-up/index.js";
|
|
71
70
|
export * from "./icons/icon-archive/index.js";
|
|
@@ -378,5 +377,6 @@ export * from "./icons/icon-youtube/index.js";
|
|
|
378
377
|
export * from "./icons/icon-zap/index.js";
|
|
379
378
|
export * from "./icons/icon-zoom-in/index.js";
|
|
380
379
|
export * from "./icons/icon-zoom-out/index.js";
|
|
380
|
+
export * from "./tab-panel/index.js";
|
|
381
381
|
export * from "./menu-item/index.js";
|
|
382
382
|
export * from "./menu-heading/index.js";
|
package/package.json
CHANGED