@ostack.tech/ui 0.8.1 → 0.9.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 (65) hide show
  1. package/dist/chunks/{en-BfgHKQwn.js → en-Dem8nwZz.js} +20 -6
  2. package/dist/chunks/en-Dem8nwZz.js.map +1 -0
  3. package/dist/chunks/platformUtils-C3IHCr90.js +6 -0
  4. package/dist/chunks/platformUtils-C3IHCr90.js.map +1 -0
  5. package/dist/locales/en-GB.js +4 -4
  6. package/dist/locales/en-GB.js.map +1 -1
  7. package/dist/locales/en-US.js +4 -4
  8. package/dist/locales/en-US.js.map +1 -1
  9. package/dist/locales/fr-FR.js +49 -8
  10. package/dist/locales/fr-FR.js.map +1 -1
  11. package/dist/locales/pt-PT.js +35 -8
  12. package/dist/locales/pt-PT.js.map +1 -1
  13. package/dist/ostack-ui.css +33 -10
  14. package/dist/ostack-ui.css.map +1 -1
  15. package/dist/ostack-ui.js +809 -356
  16. package/dist/ostack-ui.js.map +1 -1
  17. package/dist/types/components/Alert/Alert.d.ts +1 -1
  18. package/dist/types/components/Button/Button.d.ts +20 -0
  19. package/dist/types/components/Calendar/Calendar.d.ts +9 -6
  20. package/dist/types/components/Calendar/CalendarContext.d.ts +4 -1
  21. package/dist/types/components/Calendar/{CalendarMonthCaption.d.ts → CalendarHeader.d.ts} +1 -1
  22. package/dist/types/components/CheckboxGroup/CheckboxGroupContext.d.ts +62 -4
  23. package/dist/types/components/CommandMenu/CommandMenuItem.d.ts +1 -1
  24. package/dist/types/components/DateInput/DateInput.d.ts +10 -17
  25. package/dist/types/components/DateRangeInput/DateRangeInput.d.ts +11 -13
  26. package/dist/types/components/DropdownMenu/DropdownMenuCheckboxItem.d.ts +1 -1
  27. package/dist/types/components/DropdownMenu/DropdownMenuItem.d.ts +1 -1
  28. package/dist/types/components/DropdownMenu/DropdownMenuRadioItem.d.ts +1 -1
  29. package/dist/types/components/IconButton/IconButton.d.ts +24 -7
  30. package/dist/types/components/Keybinds/Key.d.ts +9 -0
  31. package/dist/types/components/Keybinds/KeyPress.d.ts +7 -0
  32. package/dist/types/components/Keybinds/Keybind.d.ts +7 -0
  33. package/dist/types/components/Keybinds/Keybinds.d.ts +20 -0
  34. package/dist/types/components/Keybinds/index.d.ts +1 -0
  35. package/dist/types/components/Label/Label.d.ts +0 -2
  36. package/dist/types/components/MenuList/MenuListItem.d.ts +15 -0
  37. package/dist/types/components/Spinner/Spinner.d.ts +2 -8
  38. package/dist/types/components/Tabs/TabList.d.ts +10 -1
  39. package/dist/types/components/Toast/Toast.d.ts +9 -0
  40. package/dist/types/components/VisuallyHidden/VisuallyHidden.d.ts +20 -2
  41. package/dist/types/index.d.ts +1 -0
  42. package/dist/types/locales/en.d.ts +1 -1
  43. package/dist/types/providers/LocalizationProvider/LocalizationObject.d.ts +10 -6
  44. package/dist/types/utils/intersperse.d.ts +8 -0
  45. package/dist/types/utils/keyboardShortcut.d.ts +21 -8
  46. package/dist/types/utils/parseDateStrict.d.ts +3 -1
  47. package/dist/types/utils/platformUtils.d.ts +2 -0
  48. package/dist/types/utils/useDateTransformer.d.ts +10 -31
  49. package/package.json +2 -2
  50. package/scss/_utils.scss +1 -0
  51. package/scss/components/Button/_Button.scss +5 -0
  52. package/scss/components/Calendar/_Calendar-variables.scss +16 -16
  53. package/scss/components/Calendar/_Calendar.scss +16 -16
  54. package/scss/components/IconButton/_IconButton.scss +5 -0
  55. package/scss/components/Keyboard/_Keyboard-variables.scss +18 -0
  56. package/scss/components/Keyboard/_Keyboard.scss +13 -10
  57. package/scss/components/MenuList/_MenuList.scss +4 -0
  58. package/scss/components/Tooltip/_Tooltip-variables.scss +4 -0
  59. package/scss/components/Tooltip/_Tooltip.scss +1 -0
  60. package/scss/scss/helpers/_visually-hidden.scss +11 -2
  61. package/scss/scss/placeholders/button/_button-variables.scss +4 -0
  62. package/scss/scss/placeholders/button/_button.scss +4 -0
  63. package/scss/scss/placeholders/menu/_menu-variables.scss +92 -1
  64. package/scss/scss/placeholders/menu/_menu.scss +61 -1
  65. package/dist/chunks/en-BfgHKQwn.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import { Locale as DateFnsLocale } from 'date-fns';
1
+ import { Locale as DayPickerLocale } from 'react-day-picker';
2
2
  import { CalendarProps } from '../../components/Calendar';
3
3
  import { CloseButtonProps } from '../../components/CloseButton';
4
4
  import { CommandMenuDialogProps, CommandMenuProps } from '../../components/CommandMenu';
@@ -11,18 +11,20 @@ import { FeedbackProps } from '../../components/Feedback';
11
11
  import { FeedbackPopoverProps } from '../../components/FeedbackPopover';
12
12
  import { FieldGroupHeaderProps } from '../../components/FieldGroup';
13
13
  import { InputProps } from '../../components/Input';
14
+ import { KeybindsProps } from '../../components/Keybinds';
14
15
  import { LabelProps } from '../../components/Label';
15
16
  import { NumericInputProps } from '../../components/NumericInput';
16
17
  import { SelectProps } from '../../components/Select';
17
18
  import { TableColumnProps, TableHeadProps } from '../../components/Table';
19
+ import { TabListProps } from '../../components/Tabs';
18
20
  import { ToastProviderProps, ToastViewportProps } from '../../components/Toast';
19
21
  import { ConfirmDialogOptions } from '../AlertDialogProvider';
20
22
  /** Localization object representation. */
21
23
  export interface LocalizationObject {
22
24
  languageTag: string;
23
- dateFnsLocale: DateFnsLocale;
25
+ dayPickerLocale: DayPickerLocale;
24
26
  AlertDialog: Pick<ConfirmDialogOptions, "okText">;
25
- Calendar: Pick<CalendarProps, "previousMonthLabel" | "nextMonthLabel">;
27
+ Calendar: Pick<CalendarProps, "monthSelectLabel" | "yearSelectLabel" | "previousMonthLabel" | "nextMonthLabel">;
26
28
  CloseButton: Pick<CloseButtonProps, "label">;
27
29
  CommandMenu: Pick<CommandMenuProps, "label" | "searchPlaceholder" | "listLabel" | "loadingLabel" | "emptyMessage">;
28
30
  CommandMenuDialog: Pick<CommandMenuDialogProps, "title" | "description">;
@@ -32,18 +34,20 @@ export interface LocalizationObject {
32
34
  DataTableFilter: Pick<DataTableFilterProps, "aria-label" | "placeholder">;
33
35
  DataTablePagination: Pick<DataTablePaginationProps, "rowsRange" | "previousPageButtonLabel" | "nextPageButtonLabel">;
34
36
  DataTableRowsPerPage: Pick<DataTableRowsPerPageProps, "label">;
35
- DateInput: Pick<DateInputProps, "shortFormat" | "fullFormat" | "placeholder" | "formatDescription" | "calendarButtonLabel">;
36
- DateRangeInput: Pick<DateRangeInputProps, "startInputLabel" | "endInputLabel" | "calendarButtonLabel">;
37
+ DateInput: Pick<DateInputProps, "format" | "announcedFormat" | "placeholder" | "formatDescription" | "selectedDateDescription" | "calendarButtonLabel">;
38
+ DateRangeInput: Pick<DateRangeInputProps, "startInputLabel" | "endInputLabel" | "selectedDateRangeDescription" | "calendarButtonLabel">;
37
39
  ErrorBoundary: Pick<ErrorBoundaryProps, "fallbackTitle" | "fallbackMessage" | "resetButtonLabel">;
38
40
  Feedback: Pick<FeedbackProps, "visuallyHiddenPrefix">;
39
41
  FeedbackPopover: Pick<FeedbackPopoverProps, "label">;
40
42
  FieldGroupHeader: Pick<FieldGroupHeaderProps, "visuallyHiddenCodePrefix">;
41
43
  Input: Pick<InputProps, "loadingDescription" | "clearButtonLabel">;
42
- Label: Pick<LabelProps, "requiredIconLabel" | "helperButtonLabel">;
44
+ Keybinds: Pick<KeybindsProps, "keybindsSeparatorLabel" | "keyPressesSeparatorLabel" | "keysSeparatorLabel" | "keySymbols" | "keyLabels">;
45
+ Label: Pick<LabelProps, "helperButtonLabel">;
43
46
  NumericInput: Pick<NumericInputProps, "decimalSeparator" | "groupingStyle" | "groupSeparator">;
44
47
  Select: Pick<SelectProps, "searchPlaceholder" | "emptyMessage" | "optionsLabel" | "loadingOptionsLabel">;
45
48
  TableColumn: Pick<TableColumnProps, "helperButtonLabel">;
46
49
  TableHead: Pick<TableHeadProps, "sortByColumnDescription">;
50
+ TabList: Pick<TabListProps, "scrollLeftButtonLabel" | "scrollRightButtonLabel">;
47
51
  ToastProvider: Pick<ToastProviderProps, "label">;
48
52
  ToastViewport: Pick<ToastViewportProps, "label">;
49
53
  }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Intersperse an array with a separator.
3
+ *
4
+ * @param array Array to intersperse.
5
+ * @param separator Separator to insert between elements.
6
+ * @returns Interspersed array.
7
+ */
8
+ export declare function intersperse<T, TSep>(array: T[], separator: TSep | ((index: number) => TSep)): (T | TSep)[];
@@ -1,3 +1,5 @@
1
+ /** Keyboard shortcut keybinds. */
2
+ export type KeyboardShortcutKeybinds = string[] | string | null | undefined;
1
3
  /** Type of the shortcut action. */
2
4
  export type KeyboardShortcutAction = (event: KeyboardEvent) => void;
3
5
  /** Options of the `registerKeyboardShortcut` function. */
@@ -62,15 +64,11 @@ export interface RegisterKeyboardShortcutOptions {
62
64
  * @returns Function used to unregister the shortcut.
63
65
  * @see {@link useKeyboardShortcut} for a hook version of this function.
64
66
  */
65
- export declare function registerKeyboardShortcut(keybinds: string | string[], action: KeyboardShortcutAction, { target, eventType, sequenceTimeout, ignore, capture, preventDefault, }?: RegisterKeyboardShortcutOptions): () => void;
67
+ export declare function registerKeyboardShortcut(keybinds: NonNullable<KeyboardShortcutKeybinds>, action: KeyboardShortcutAction, { target, eventType, sequenceTimeout, ignore, capture, preventDefault, }?: RegisterKeyboardShortcutOptions): () => void;
66
68
  /** Options of the `useKeyboardShortcut` hook. */
67
69
  export interface UseKeyboardShortcutOptions extends Omit<RegisterKeyboardShortcutOptions, "target"> {
68
- /**
69
- * Whether the shortcut should be enabled.
70
- *
71
- * @default true
72
- */
73
- enabled?: boolean;
70
+ /** Whether the shortcut should be disabled. */
71
+ disabled?: boolean;
74
72
  /**
75
73
  * Target element on which to listen for the keybinds. While set to `null`
76
74
  * keybinds will be ignored.
@@ -108,10 +106,25 @@ export interface UseKeyboardShortcutOptions extends Omit<RegisterKeyboardShortcu
108
106
  * @see {@link registerKeyboardShortcut} for a non-hook version of this
109
107
  * function.
110
108
  */
111
- export declare function useKeyboardShortcut(keybinds: string | string[] | null | undefined, action: KeyboardShortcutAction, { enabled, target, eventType, sequenceTimeout, ignore, capture, preventDefault, }?: UseKeyboardShortcutOptions): void;
109
+ export declare function useKeyboardShortcut(keybinds: KeyboardShortcutKeybinds, action: KeyboardShortcutAction, { disabled, target, eventType, sequenceTimeout, ignore, capture, preventDefault, }?: UseKeyboardShortcutOptions): void;
112
110
  /**
113
111
  * `ignore` function to use in `registerKeyboardShortcut`/`useKeyboardShortcut`
114
112
  * which ignores triggered shortcuts which occur in `<input>`, `<textarea>`, or
115
113
  * `<select>` elements.
116
114
  */
117
115
  export declare function ignoreFormControlsKeyboardShortcut(event: KeyboardEvent): boolean;
116
+ /**
117
+ * Normalises `tinykeys` keybinds into an array of keybinds.
118
+ *
119
+ * @param keybinds `tinykeys` keybinds to normalise.
120
+ * @returns Normalised keybinds.
121
+ */
122
+ export declare function normalizeKeybinds(keybinds: KeyboardShortcutKeybinds): string[][][];
123
+ /**
124
+ * Converts the provided `tinykeys` keybinds into an `aria-keyshortcuts` string.
125
+ *
126
+ * @param keybinds `tinykeys` keybinds to convert into `aria-keyshortcuts`
127
+ * string.
128
+ * @returns `aria-keyshortcuts` string.
129
+ */
130
+ export declare function keybindsToAriaKeyShortcuts(keybinds: KeyboardShortcutKeybinds): string | undefined;
@@ -4,4 +4,6 @@ import { FormatOptions, ParseOptions } from 'date-fns';
4
4
  *
5
5
  * Workaround for: https://github.com/date-fns/date-fns/issues/942
6
6
  */
7
- export declare function parseDateStrict(dateString: string, dateFormat: string, options?: ParseOptions & FormatOptions): Date | null;
7
+ export declare function parseDateStrict(dateString: string, dateFormat: string, options?: ParseOptions & FormatOptions & {
8
+ referenceDate?: Date;
9
+ }): Date | null;
@@ -0,0 +1,2 @@
1
+ export declare const PLATFORM: string;
2
+ export declare const IS_APPLE: boolean;
@@ -1,43 +1,22 @@
1
1
  import { Locale } from 'date-fns';
2
- /** Default short date format. */
3
- export declare const DEFAULT_SHORT_DATE_FORMAT = "yyyy-MM-dd";
4
- /** Default full date format. */
5
- export declare const DEFAULT_FULL_DATE_FORMAT = "EEEE, d MMMM yyyy";
2
+ /** Default date format. */
3
+ export declare const DEFAULT_DATE_FORMAT = "yyyy-MM-dd";
6
4
  /** Options of the `useDateTransformer` hook. */
7
5
  export interface DateTransformerOptions {
8
6
  /** `date-fns` locale to format dates. */
9
7
  locale?: Locale;
10
8
  /**
11
- * Short format of the date, as supported by
9
+ * Format of the date, as supported by
12
10
  * [`date-fns`](https://date-fns.org/docs/format).
13
11
  */
14
- shortFormat?: string;
15
- /**
16
- * Full format of the date, as supported by
17
- * [`date-fns`](https://date-fns.org/docs/format).
18
- */
19
- fullFormat?: string;
20
- }
21
- /** Available formatting widths. */
22
- export type DateFormatWidth = "short" | "full";
23
- /** Optons of the date formatter. */
24
- export interface DateFormatterOptions {
25
- /**
26
- * Formatted date width.
27
- *
28
- * @default short
29
- */
30
- width?: DateFormatWidth;
12
+ format?: string;
31
13
  }
32
- /** Optons of the date parser. */
33
- export interface DateParserOptions {
34
- /**
35
- * Formatted date width.
36
- *
37
- * @default short
38
- */
39
- width?: DateFormatWidth;
14
+ /** Options used to parse a date string. */
15
+ export interface DateParserOptions extends DateTransformerOptions {
16
+ referenceDate?: Date;
40
17
  }
18
+ /** Options used to format a date. */
19
+ export type DateFormatterOptions = DateTransformerOptions;
41
20
  /** Date transformer. */
42
21
  export interface DateTransformer {
43
22
  /** Function used to strictly parse a string as a date. */
@@ -50,4 +29,4 @@ export interface DateTransformer {
50
29
  * the current locale. By default, the returned functions transform a date in
51
30
  * the same way a `DateInput` would.
52
31
  */
53
- export declare function useDateTransformer({ locale: dateFnsLocale, shortFormat, fullFormat, }?: DateTransformerOptions): DateTransformer;
32
+ export declare function useDateTransformer({ locale: dateFnsLocale, format, }?: DateTransformerOptions): DateTransformer;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ostack.tech/ui",
3
3
  "description": "ostack/UI component library.",
4
- "version": "0.8.1",
4
+ "version": "0.9.0",
5
5
  "homepage": "https://ui.ostack.tech/",
6
6
  "author": {
7
7
  "name": "Opensoft",
@@ -49,7 +49,7 @@
49
49
  "cmdk": "^1.1.1",
50
50
  "from-exponential": "^1.1.1",
51
51
  "radix-ui": "^1.4.3",
52
- "react-day-picker": "^9.11.3",
52
+ "react-day-picker": "^9.13.0",
53
53
  "react-error-boundary": "^6.0.0",
54
54
  "react-number-format": "^5.4.4",
55
55
  "react-to-print": "^3.2.0",
package/scss/_utils.scss CHANGED
@@ -46,6 +46,7 @@
46
46
  @forward "components/IconButton/IconButton-variables";
47
47
  @forward "components/CloseButton/CloseButton-variables";
48
48
  @forward "components/Input/Input-variables";
49
+ @forward "components/Keyboard/Keyboard-variables";
49
50
  @forward "components/Link/Link-variables";
50
51
  @forward "components/Mark/Mark-variables";
51
52
  @forward "components/Overlay/Overlay-variables";
@@ -133,4 +133,9 @@
133
133
  @extend %#{$prefix}button--#{$variant};
134
134
  }
135
135
  }
136
+
137
+ // Keybinds
138
+ &__keybinds {
139
+ @extend %#{$prefix}button__keybinds;
140
+ }
136
141
  }
@@ -13,27 +13,27 @@ $calendar-month-border-width: 1px !default;
13
13
  $calendar-month-border-color: var(--#{$prefix}neutral-a7) !default;
14
14
  $calendar-month-background-color: var(--#{$prefix}background-color) !default;
15
15
 
16
- // Caption
17
- $calendar-caption-gap-x: spacing(0.5) !default;
18
- $calendar-caption-background-color: var(--#{$prefix}primary-9) !default;
19
- $calendar-caption-color: var(--#{$prefix}primary-contrast) !default;
16
+ // Header
17
+ $calendar-header-gap-x: spacing(0.5) !default;
18
+ $calendar-header-background-color: var(--#{$prefix}primary-9) !default;
19
+ $calendar-header-color: var(--#{$prefix}primary-contrast) !default;
20
20
 
21
- // Caption label
22
- $calendar-caption-label-padding-y: spacing(1) !default;
23
- $calendar-caption-label-padding-x: spacing(2) !default;
21
+ // Header label
22
+ $calendar-header-label-padding-y: spacing(1) !default;
23
+ $calendar-header-label-padding-x: spacing(2) !default;
24
24
 
25
- // Caption button
26
- $calendar-caption-button-background-color: transparent !default;
27
- $calendar-caption-button-color: inherit !default;
25
+ // Header button
26
+ $calendar-header-button-background-color: transparent !default;
27
+ $calendar-header-button-color: inherit !default;
28
28
 
29
- // Caption button - Focus
30
- $calendar-caption-button-focus-outline-color: rgba(255, 255, 255, 0.3) !default;
29
+ // Header button - Focus
30
+ $calendar-header-button-focus-outline-color: rgba(255, 255, 255, 0.3) !default;
31
31
 
32
- // Caption button - Hover
33
- $calendar-caption-button-hover-background-color: rgba(0, 0, 0, 0.1) !default;
32
+ // Header button - Hover
33
+ $calendar-header-button-hover-background-color: rgba(0, 0, 0, 0.1) !default;
34
34
 
35
- // Caption button - Active
36
- $calendar-caption-button-active-background-color: rgba(0, 0, 0, 0.2) !default;
35
+ // Header button - Active
36
+ $calendar-header-button-active-background-color: rgba(0, 0, 0, 0.2) !default;
37
37
 
38
38
  // Select
39
39
  $calendar-select-padding-x: spacing(2.5) !default;
@@ -44,7 +44,7 @@
44
44
  border: 0;
45
45
  }
46
46
 
47
- &__caption {
47
+ &__header {
48
48
  display: flex;
49
49
  align-items: center;
50
50
  justify-content: space-between;
@@ -56,20 +56,20 @@
56
56
  border-top-left-radius: $calendar-month-border-radius;
57
57
  border-top-right-radius: $calendar-month-border-radius;
58
58
 
59
- background-color: $calendar-caption-background-color;
60
- color: $calendar-caption-color;
59
+ background-color: $calendar-header-background-color;
60
+ color: $calendar-header-color;
61
61
  }
62
62
 
63
- &__caption-label {
63
+ &__header-label {
64
64
  margin: 0;
65
- padding: $calendar-caption-label-padding-y $calendar-caption-label-padding-x;
65
+ padding: $calendar-header-label-padding-y $calendar-header-label-padding-x;
66
66
  }
67
67
 
68
68
  &__navigation {
69
69
  min-width: $calendar-day-inner-size;
70
70
 
71
71
  & > :not(:last-child) {
72
- margin-right: $calendar-caption-gap-x;
72
+ margin-right: $calendar-header-gap-x;
73
73
  }
74
74
  }
75
75
 
@@ -77,21 +77,21 @@
77
77
  display: flex;
78
78
 
79
79
  & > :not(:last-child) {
80
- margin-right: $calendar-caption-gap-x;
80
+ margin-right: $calendar-header-gap-x;
81
81
  }
82
82
  }
83
83
 
84
84
  // Override button styles
85
85
  & &__navigation-button {
86
86
  color: inherit;
87
- background-color: $calendar-caption-button-background-color;
88
- outline-color: $calendar-caption-button-focus-outline-color;
87
+ background-color: $calendar-header-button-background-color;
88
+ outline-color: $calendar-header-button-focus-outline-color;
89
89
 
90
90
  &:is(:hover, :focus):not(:active):not(:disabled) {
91
- background-color: $calendar-caption-button-hover-background-color !important;
91
+ background-color: $calendar-header-button-hover-background-color !important;
92
92
  }
93
93
  &:active:not(:disabled) {
94
- background-color: $calendar-caption-button-active-background-color !important;
94
+ background-color: $calendar-header-button-active-background-color !important;
95
95
  }
96
96
  }
97
97
 
@@ -109,19 +109,19 @@
109
109
 
110
110
  .#{$prefix}input__container {
111
111
  border: 0;
112
- background-color: $calendar-caption-button-background-color !important;
112
+ background-color: $calendar-header-button-background-color !important;
113
113
  background-image: none;
114
- color: $calendar-caption-button-color;
114
+ color: $calendar-header-button-color;
115
115
  box-shadow: none;
116
116
 
117
117
  &[data-focused]:not([data-disabled]) {
118
- box-shadow: 0 0 0 2px $calendar-caption-button-focus-outline-color;
118
+ box-shadow: 0 0 0 2px $calendar-header-button-focus-outline-color;
119
119
  }
120
120
  &:is(:hover, [data-focused]):not([data-disabled]):not([data-state="open"]) {
121
- background-color: $calendar-caption-button-hover-background-color !important;
121
+ background-color: $calendar-header-button-hover-background-color !important;
122
122
  }
123
123
  &[data-state="open"] {
124
- background-color: $calendar-caption-button-active-background-color !important;
124
+ background-color: $calendar-header-button-active-background-color !important;
125
125
  }
126
126
  }
127
127
 
@@ -38,4 +38,9 @@
38
38
  @extend %#{$prefix}button--#{$variant};
39
39
  }
40
40
  }
41
+
42
+ // Keybinds
43
+ &__keybinds {
44
+ @extend %#{$prefix}button__keybinds;
45
+ }
41
46
  }
@@ -0,0 +1,18 @@
1
+ @use "../../scss/base-variables" as *;
2
+ @use "../../scss/utils/spacing" as *;
3
+ @use "../../scss/utils/css-color-functions" as *;
4
+
5
+ $keyboard-padding: 0 0.25em !default;
6
+ $keyboard-border-radius: var(--#{$prefix}border-radius-sm) !default;
7
+
8
+ $keyboard-font-family: var(--#{$prefix}font-family-code) !default;
9
+ $keyboard-font-weight: $font-weight-normal !default;
10
+ $keyboard-font-size: 0.875em !default;
11
+ $keyboard-line-height: 1 !default;
12
+ $keyboard-word-wrap: break-word !default;
13
+
14
+ $keyboard-border-width: 1px 1px 2px !default;
15
+ $keyboard-border-style: solid !default;
16
+ $keyboard-border-color: css-transparentize(currentColor, 0.125) !default;
17
+ $keyboard-background-color: css-transparentize(currentColor, 0.065) !default;
18
+ $keyboard-color: null !default;
@@ -1,17 +1,20 @@
1
+ @use "Keyboard-variables" as *;
1
2
  @use "../../scss/base-variables" as *;
2
3
  @use "../../scss/utils/spacing" as *;
3
4
 
4
5
  .#{$prefix}keyboard {
5
- padding: 1px spacing(1) 0;
6
- border-radius: var(--#{$prefix}border-radius-xs);
6
+ padding: $keyboard-padding;
7
+ border-radius: $keyboard-border-radius;
7
8
 
8
- font-family: var(--#{$prefix}font-family-code);
9
- font-weight: $font-weight-normal;
10
- font-size: 0.875em;
11
- word-wrap: break-word;
9
+ font-family: $keyboard-font-family;
10
+ font-weight: $keyboard-font-weight;
11
+ font-size: $keyboard-font-size;
12
+ line-height: $keyboard-line-height;
13
+ word-wrap: $keyboard-word-wrap;
12
14
 
13
- border: 1px solid $neutral-7;
14
- border-bottom-width: 3px;
15
- background-color: $neutral-3;
16
- color: $neutral-11;
15
+ border-width: $keyboard-border-width;
16
+ border-style: $keyboard-border-style;
17
+ border-color: $keyboard-border-color;
18
+ background-color: $keyboard-background-color;
19
+ color: $keyboard-color;
17
20
  }
@@ -72,6 +72,10 @@
72
72
  @extend %#{$prefix}menu__item-icon--end;
73
73
  }
74
74
 
75
+ &__item-keybinds {
76
+ @extend %#{$prefix}menu__item-keybinds;
77
+ }
78
+
75
79
  &__item-spinner {
76
80
  @extend %#{$prefix}menu__item-spinner;
77
81
  }
@@ -5,12 +5,16 @@ $tooltip-max-width: 200px !default;
5
5
  $tooltip-max-height: 600px !default;
6
6
  $tooltip-padding-y: spacing(1) !default;
7
7
  $tooltip-padding-x: spacing(2) !default;
8
+
8
9
  $tooltip-border-radius: var(--#{$prefix}border-radius-sm) !default;
9
10
  $tooltip-font-size: var(--#{$prefix}font-size-xs) !default;
10
11
  $tooltip-line-height: var(--#{$prefix}line-height-xs) !default;
12
+ $tooltip-text-align: center !default;
13
+
11
14
  $tooltip-background-color: var(--#{$prefix}neutral-12) !default;
12
15
  $tooltip-color: var(--#{$prefix}neutral-1) !default;
13
16
  $tooltip-box-shadow: var(--#{$prefix}box-shadow-sm) !default;
17
+
14
18
  $tooltip-z-index: var(--#{$prefix}z-index-tooltip) !default;
15
19
  $tooltip-animation-duration: var(--#{$prefix}animation-fade-duration) !default;
16
20
  $tooltip-animation-timing-function: var(
@@ -16,6 +16,7 @@
16
16
 
17
17
  font-size: $tooltip-font-size;
18
18
  line-height: $tooltip-line-height;
19
+ text-align: $tooltip-text-align;
19
20
 
20
21
  background-color: $tooltip-background-color;
21
22
  color: $tooltip-color;
@@ -6,13 +6,22 @@
6
6
  // Hide content visually while keeping it accessible to assistive technologies
7
7
  .#{$prefix}visually-hidden,
8
8
  .#{$prefix}visually-hidden-focusable:not(:focus):not(:focus-within) {
9
- position: absolute !important;
10
9
  width: 1px !important;
11
10
  height: 1px !important;
12
11
  padding: 0 !important;
13
- margin: -1px !important;
12
+ margin: -1px !important; // Fix for https://github.com/twbs/bootstrap/issues/25686
14
13
  overflow: hidden !important;
15
14
  clip: rect(0, 0, 0, 0) !important;
16
15
  white-space: nowrap !important;
17
16
  border: 0 !important;
17
+
18
+ // Fix for positioned table caption that could become anonymous cells
19
+ &:not(caption) {
20
+ position: absolute !important;
21
+ }
22
+
23
+ // Fix to prevent overflowing children to become focusable
24
+ * {
25
+ overflow: hidden !important;
26
+ }
18
27
  }
@@ -2,6 +2,7 @@
2
2
  @use "sass:map";
3
3
 
4
4
  @use "../../base-variables" as *;
5
+ @use "../../utils/spacing" as *;
5
6
 
6
7
  $button-cursor: pointer !default;
7
8
  $button-border-width: 1px !default;
@@ -133,6 +134,9 @@ $button-ghost-active-filter: null !default;
133
134
  // Ghost variant - Open
134
135
  $button-ghost-open-box-shadow: null !default;
135
136
 
137
+ // Keybinds
138
+ $button-keybinds-margin-y: spacing(1);
139
+
136
140
  // Variants
137
141
  $button-variants: solid, subtle, outlined, ghost !default;
138
142
 
@@ -150,4 +150,8 @@
150
150
  );
151
151
  }
152
152
  }
153
+
154
+ &__keybinds:not(:first-child) {
155
+ margin-top: $button-keybinds-margin-y;
156
+ }
153
157
  }
@@ -176,12 +176,61 @@ $menu-item-icon-subtle-highlighted-selected-color: null !default;
176
176
  // Item icon - Subtle variant - Highlighted + Selected + Accent
177
177
  $menu-item-icon-subtle-highlighted-selected-accent-color: null !default;
178
178
 
179
+ // Item shortcut
180
+ $menu-item-keybinds-margin-x: $menu-item-padding-x !default;
181
+ $menu-item-keybinds-font-size: var(--#{$prefix}font-size-xs) !default;
182
+ $menu-item-keybinds-line-height: var(--#{$prefix}line-height-xs) !default;
183
+ $menu-item-keybinds-color: var(--#{$prefix}neutral-11) !default;
184
+
185
+ // Item shortcut - Solid variant - Accent
186
+ $menu-item-keybinds-solid-accent-color: var(--#{$prefix}accent-10) !default;
187
+
188
+ // Item shortcut - Solid variant - Highlighted
189
+ $menu-item-keybinds-solid-highlighted-color: $menu-item-icon-solid-highlighted-color !default;
190
+
191
+ // Item shortcut - Solid variant - Highlighted + Accent
192
+ $menu-item-keybinds-solid-highlighted-accent-color: $menu-item-icon-solid-highlighted-accent-color !default;
193
+
194
+ // Item shortcut - Solid variant - Selected
195
+ $menu-item-keybinds-solid-selected-color: $menu-item-icon-solid-selected-color !default;
196
+
197
+ // Item shortcut - Solid variant - Selected + Accent
198
+ $menu-item-keybinds-solid-selected-accent-color: $menu-item-icon-solid-selected-accent-color !default;
199
+
200
+ // Item shortcut - Solid variant - Highlighted + Selected
201
+ $menu-item-keybinds-solid-highlighted-selected-color: $menu-item-icon-solid-highlighted-selected-color !default;
202
+
203
+ // Item shortcut - Solid variant - Highlighted + Selected + Accent
204
+ $menu-item-keybinds-solid-highlighted-selected-accent-color: $menu-item-icon-solid-highlighted-selected-accent-color !default;
205
+
206
+ // Item shortcut - Subtle variant - Accent
207
+ $menu-item-keybinds-subtle-accent-color: var(--#{$prefix}accent-11) !default;
208
+
209
+ // Item shortcut - Subtle variant - Highlighted
210
+ $menu-item-keybinds-subtle-highlighted-color: null !default;
211
+
212
+ // Item shortcut - Subtle variant - Highlighted + Accent
213
+ $menu-item-keybinds-subtle-highlighted-accent-color: null !default;
214
+
215
+ // Item shortcut - Subtle variant - Selected
216
+ $menu-item-keybinds-subtle-selected-color: var(--#{$prefix}neutral-12) !default;
217
+
218
+ // Item shortcut - Subtle variant - Selected + Accent
219
+ $menu-item-keybinds-subtle-selected-accent-color: var(
220
+ --#{$prefix}accent-12
221
+ ) !default;
222
+
223
+ // Item shortcut - Subtle variant - Highlighted + Selected
224
+ $menu-item-keybinds-subtle-highlighted-selected-color: null !default;
225
+
226
+ // Item shortcut - Subtle variant - Highlighted + Selected + Accent
227
+ $menu-item-keybinds-subtle-highlighted-selected-accent-color: null !default;
228
+
179
229
  // Sub trigger icon
180
230
  $menu-sub-trigger-icon-font-size: var(--#{$prefix}font-size-2xs) !default;
181
231
 
182
232
  // Checkable
183
233
  $menu-checkable-size: 16px !default;
184
- $menu-checkable-margin-x: spacing(3) !default;
185
234
  $menu-checkable-border-radius: var(--#{$prefix}border-radius-sm) !default;
186
235
  $menu-checkable-border-width: 1px !default;
187
236
  $menu-checkable-font-size: var(--#{$prefix}font-size-xs) !default;
@@ -312,6 +361,48 @@ $menu-item-icon-highlighted-selected-accent-color-by-variant: (
312
361
  subtle: $menu-item-icon-subtle-highlighted-selected-accent-color,
313
362
  ) !default;
314
363
 
364
+ // Item shortcut - Accent
365
+ $menu-item-keybinds-accent-color-by-variant: (
366
+ solid: $menu-item-keybinds-solid-accent-color,
367
+ subtle: $menu-item-keybinds-subtle-accent-color,
368
+ ) !default;
369
+
370
+ // Item shortcut - Highlighted
371
+ $menu-item-keybinds-highlighted-color-by-variant: (
372
+ solid: $menu-item-keybinds-solid-highlighted-color,
373
+ subtle: $menu-item-keybinds-subtle-highlighted-color,
374
+ ) !default;
375
+
376
+ // Item shortcut - Highlighted + Accent
377
+ $menu-item-keybinds-highlighted-accent-color-by-variant: (
378
+ solid: $menu-item-keybinds-solid-highlighted-accent-color,
379
+ subtle: $menu-item-keybinds-subtle-highlighted-accent-color,
380
+ ) !default;
381
+
382
+ // Item shortcut - Selected
383
+ $menu-item-keybinds-selected-color-by-variant: (
384
+ solid: $menu-item-keybinds-solid-selected-color,
385
+ subtle: $menu-item-keybinds-subtle-selected-color,
386
+ ) !default;
387
+
388
+ // Item shortcut - Selected + Accent
389
+ $menu-item-keybinds-selected-accent-color-by-variant: (
390
+ solid: $menu-item-keybinds-solid-selected-accent-color,
391
+ subtle: $menu-item-keybinds-subtle-selected-accent-color,
392
+ ) !default;
393
+
394
+ // Item shortcut - Highlighted + Selected
395
+ $menu-item-keybinds-highlighted-selected-color-by-variant: (
396
+ solid: $menu-item-keybinds-solid-highlighted-selected-color,
397
+ subtle: $menu-item-keybinds-subtle-highlighted-selected-color,
398
+ ) !default;
399
+
400
+ // Item shortcut - Highlighted + Selected + Accent
401
+ $menu-item-keybinds-highlighted-selected-accent-color-by-variant: (
402
+ solid: $menu-item-keybinds-solid-highlighted-selected-accent-color,
403
+ subtle: $menu-item-keybinds-subtle-highlighted-selected-accent-color,
404
+ ) !default;
405
+
315
406
  // Checkable indicator - Highlighted
316
407
  $menu-checkable-indicator-highlighted-color-by-variant: (
317
408
  solid: $menu-checkable-indicator-solid-highlighted-color,