@gooddata/sdk-ui-kit 11.58.0-alpha.1 → 11.58.0-alpha.3

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 (35) hide show
  1. package/esm/@ui/UiModalDialog/UiModalDialog.d.ts +10 -3
  2. package/esm/@ui/UiModalDialog/UiModalDialog.d.ts.map +1 -1
  3. package/esm/@ui/UiModalDialog/UiModalDialog.js +4 -4
  4. package/esm/@ui/UiRestrictedPlaceholder/UiRestrictedPlaceholder.d.ts +33 -0
  5. package/esm/@ui/UiRestrictedPlaceholder/UiRestrictedPlaceholder.d.ts.map +1 -0
  6. package/esm/@ui/UiRestrictedPlaceholder/UiRestrictedPlaceholder.js +16 -0
  7. package/esm/Header/Header.test.helpers.d.ts.map +1 -1
  8. package/esm/Header/Header.test.helpers.js +1 -0
  9. package/esm/Header/generateHeaderMenuItemsGroups.js +2 -2
  10. package/esm/RichText/RestrictedReferenceMarker.d.ts +18 -0
  11. package/esm/RichText/RestrictedReferenceMarker.d.ts.map +1 -0
  12. package/esm/RichText/RestrictedReferenceMarker.js +21 -0
  13. package/esm/RichText/RichText.d.ts.map +1 -1
  14. package/esm/RichText/RichText.js +10 -1
  15. package/esm/RichText/helpers/references.d.ts +16 -0
  16. package/esm/RichText/helpers/references.d.ts.map +1 -1
  17. package/esm/RichText/helpers/references.js +22 -0
  18. package/esm/RichText/plugins/rehype-references.d.ts.map +1 -1
  19. package/esm/RichText/plugins/rehype-references.js +3 -3
  20. package/esm/RichText/plugins/types.d.ts +8 -0
  21. package/esm/RichText/plugins/types.d.ts.map +1 -1
  22. package/esm/RichText/plugins/types.js +8 -0
  23. package/esm/index.d.ts +2 -0
  24. package/esm/index.d.ts.map +1 -1
  25. package/esm/index.js +2 -0
  26. package/esm/sdk-ui-kit.d.ts +68 -2
  27. package/package.json +13 -13
  28. package/src/@ui/UiModalDialog/UiModalDialog.scss +13 -0
  29. package/src/@ui/UiRestrictedPlaceholder/UiRestrictedPlaceholder.scss +53 -0
  30. package/src/@ui/index.scss +1 -0
  31. package/styles/css/main.css +60 -6
  32. package/styles/css/main.css.map +1 -1
  33. package/styles/css/richText.css +4 -6
  34. package/styles/css/richText.css.map +1 -1
  35. package/styles/scss/richText.scss +4 -7
@@ -81,6 +81,7 @@ import { MouseEvent as MouseEvent_2 } from 'react';
81
81
  import { MouseEventHandler } from 'react';
82
82
  import { MutableRefObject } from 'react';
83
83
  import { NamedExoticComponent } from 'react';
84
+ import { ObjectType } from '@gooddata/sdk-model';
84
85
  import { ObjRef } from '@gooddata/sdk-model';
85
86
  import { OffsetOptions } from '@floating-ui/react';
86
87
  import { OnError } from '@gooddata/sdk-ui';
@@ -440,6 +441,13 @@ export declare type CodeLanguageType = "js" | "ts";
440
441
  */
441
442
  export declare function CodeOptions({ option, onChange }: ICodeOptionsProps): JSX.Element;
442
443
 
444
+ /**
445
+ * The references the text points at, by the identifier each was written with.
446
+ *
447
+ * @internal
448
+ */
449
+ export declare function collectReferences(content: string): ReferenceMap;
450
+
443
451
  /**
444
452
  * Color in format supported by SVG
445
453
  * https://www.w3.org/TR/SVGColor12/#color
@@ -8663,6 +8671,8 @@ export declare interface IUiModalDialogProps {
8663
8671
  /** Dialog content composed by the caller — typically `UiDialogHeader`,
8664
8672
  * an optional `UiDialogBody`, and `UiDialogFooter`. */
8665
8673
  children: ReactNode;
8674
+ /** Confirmation styling adds a border and emphasizes the title and body. */
8675
+ variant?: "default" | "confirmation";
8666
8676
  /** Whether the modal is shown. */
8667
8677
  isOpen: boolean;
8668
8678
  /**
@@ -8675,13 +8685,18 @@ export declare interface IUiModalDialogProps {
8675
8685
  onClose: () => void;
8676
8686
  /** Card width in px. Defaults to 540. */
8677
8687
  width?: number;
8688
+ /** Initial keyboard focus target. Defaults to the first tabbable element. */
8689
+ initialFocus?: RefObject<HTMLElement | null>;
8678
8690
  /**
8679
8691
  * Overrides for the dialog landmark's accessible name. Usually unnecessary —
8680
8692
  * the landmark auto-wires `aria-labelledby` to the `UiDialogHeader` title
8681
8693
  * via context. For headerless dialogs, pass `ariaLabel`; to point at an
8682
8694
  * external title, pass `ariaLabelledBy`.
8683
8695
  */
8684
- accessibilityConfig?: Pick<IAccessibilityConfigBase, "ariaLabel" | "ariaLabelledBy">;
8696
+ accessibilityConfig?: Pick<IAccessibilityConfigBase, "ariaLabel" | "ariaLabelledBy"> & {
8697
+ /** Use alertdialog for confirmations that require an immediate response. */
8698
+ role?: "dialog" | "alertdialog";
8699
+ };
8685
8700
  /** Test id forwarded to the overlay element. */
8686
8701
  dataTestId?: string;
8687
8702
  }
@@ -9132,6 +9147,23 @@ export declare interface IUiRadioRowProps {
9132
9147
  dataTestId?: string;
9133
9148
  }
9134
9149
 
9150
+ /**
9151
+ * @internal
9152
+ */
9153
+ export declare interface IUiRestrictedPlaceholderProps {
9154
+ /** Why the content is not shown. Never names the object, which the reader may not know of. */
9155
+ title: ReactNode;
9156
+ /** Recovery guidance; visually hidden in compact mode but available to assistive technology. */
9157
+ description?: ReactNode;
9158
+ /** @defaultValue "default" */
9159
+ size?: UiRestrictedPlaceholderSize;
9160
+ dataTestId?: string;
9161
+ accessibilityConfig?: {
9162
+ role?: HTMLAttributes<HTMLElement>["role"];
9163
+ ariaLive?: AriaAttributes["aria-live"];
9164
+ };
9165
+ }
9166
+
9135
9167
  /**
9136
9168
  * @internal
9137
9169
  */
@@ -10977,11 +11009,28 @@ export declare const REFERENCE_REGEX_MATCH: RegExp;
10977
11009
  */
10978
11010
  export declare const REFERENCE_REGEX_SPLIT: RegExp;
10979
11011
 
11012
+ /**
11013
+ * @internal
11014
+ */
11015
+ export declare type ReferenceMap = Record<string, {
11016
+ ref: ObjRef;
11017
+ type: ObjectType;
11018
+ }>;
11019
+
10980
11020
  /**
10981
11021
  * @internal
10982
11022
  */
10983
11023
  export declare const relatedHeader: IDateDatasetHeader;
10984
11024
 
11025
+ /**
11026
+ * The text with every reference pointing at one of the given objects replaced by `replacement`.
11027
+ * The markup around a reference is left alone, so emphasis that held the reference now holds the
11028
+ * replacement. The result is stored as the widget's text, and thus the replacement is not localised.
11029
+ *
11030
+ * @internal
11031
+ */
11032
+ export declare function replaceReferences(content: string, replaced: ObjRef[], replacement: string): string;
11033
+
10985
11034
  /**
10986
11035
  * @internal
10987
11036
  */
@@ -12045,7 +12094,7 @@ export declare function UiMenu<T extends IUiMenuItemData = object, M extends obj
12045
12094
  *
12046
12095
  * @internal
12047
12096
  */
12048
- export declare function UiModalDialog({ children, isOpen, onClose, width, closeOnOutsideClick, accessibilityConfig, dataTestId, }: IUiModalDialogProps): JSX.Element | null;
12097
+ export declare function UiModalDialog({ children, variant, isOpen, onClose, width, initialFocus, closeOnOutsideClick, accessibilityConfig, dataTestId, }: IUiModalDialogProps): JSX.Element | null;
12049
12098
 
12050
12099
  /**
12051
12100
  * @internal
@@ -12141,6 +12190,23 @@ export declare function UiRadioRow({ checked, onChange, name, value, title, desc
12141
12190
  */
12142
12191
  export declare type UiRefsTree = Record<string, HTMLDivElement | null>;
12143
12192
 
12193
+ /**
12194
+ * Stands in for content the viewer is not permitted to see. It takes over whatever it replaces
12195
+ * whole, title bar included: a title would name the object, and naming it tells the viewer of
12196
+ * something they may not know exists.
12197
+ *
12198
+ * @internal
12199
+ */
12200
+ export declare function UiRestrictedPlaceholder({ title, description, size, dataTestId, accessibilityConfig, }: IUiRestrictedPlaceholderProps): JSX.Element;
12201
+
12202
+ /**
12203
+ * How much of the placeholder there is room for. `compact` keeps the reason alone, which is what a
12204
+ * tile too small for the rest can show.
12205
+ *
12206
+ * @internal
12207
+ */
12208
+ export declare type UiRestrictedPlaceholderSize = "default" | "compact";
12209
+
12144
12210
  /**
12145
12211
  * @internal
12146
12212
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gooddata/sdk-ui-kit",
3
- "version": "11.58.0-alpha.1",
3
+ "version": "11.58.0-alpha.3",
4
4
  "description": "GoodData SDK - UI Building Components",
5
5
  "license": "MIT",
6
6
  "author": "GoodData Corporation",
@@ -79,11 +79,11 @@
79
79
  "unified": "^11.0.5",
80
80
  "uuid": "11.1.1",
81
81
  "yaml": "2.8.3",
82
- "@gooddata/sdk-backend-spi": "11.58.0-alpha.1",
83
- "@gooddata/sdk-model": "11.58.0-alpha.1",
84
- "@gooddata/sdk-ui": "11.58.0-alpha.1",
85
- "@gooddata/sdk-ui-theme-provider": "11.58.0-alpha.1",
86
- "@gooddata/util": "11.58.0-alpha.1"
82
+ "@gooddata/sdk-backend-spi": "11.58.0-alpha.3",
83
+ "@gooddata/sdk-ui": "11.58.0-alpha.3",
84
+ "@gooddata/sdk-model": "11.58.0-alpha.3",
85
+ "@gooddata/sdk-ui-theme-provider": "11.58.0-alpha.3",
86
+ "@gooddata/util": "11.58.0-alpha.3"
87
87
  },
88
88
  "devDependencies": {
89
89
  "@microsoft/api-documenter": "7.30.10",
@@ -124,15 +124,15 @@
124
124
  "react-dom": "19.1.1",
125
125
  "sass": "1.104.1",
126
126
  "stylelint": "16.26.1",
127
- "svgo": "2.8.3",
127
+ "svgo": "2.8.4",
128
128
  "typescript": "7.0.2",
129
- "vitest": "4.1.8",
129
+ "vitest": "4.1.11",
130
130
  "vitest-dom": "0.1.1",
131
- "@gooddata/oxlint-config": "11.58.0-alpha.1",
132
- "@gooddata/reference-workspace": "11.58.0-alpha.1",
133
- "@gooddata/sdk-backend-mockingbird": "11.58.0-alpha.1",
134
- "@gooddata/eslint-config": "11.58.0-alpha.1",
135
- "@gooddata/stylelint-config": "11.58.0-alpha.1"
131
+ "@gooddata/eslint-config": "11.58.0-alpha.3",
132
+ "@gooddata/reference-workspace": "11.58.0-alpha.3",
133
+ "@gooddata/oxlint-config": "11.58.0-alpha.3",
134
+ "@gooddata/sdk-backend-mockingbird": "11.58.0-alpha.3",
135
+ "@gooddata/stylelint-config": "11.58.0-alpha.3"
136
136
  },
137
137
  "peerDependencies": {
138
138
  "react": "^18.0.0 || ^19.0.0",
@@ -26,6 +26,19 @@
26
26
  background-color: var(--gd-palette-complementary-0);
27
27
  border-radius: var(--gd-modal-borderRadius);
28
28
  box-shadow: 0 2px 8px var(--gd-shadow-color);
29
+
30
+ &--variant-confirmation {
31
+ box-sizing: border-box;
32
+ border: 1px solid var(--gd-modal-borderColor);
33
+
34
+ .gd-ui-kit-dialog-header__title {
35
+ color: var(--gd-modal-title-color);
36
+ }
37
+
38
+ .gd-ui-kit-dialog-body {
39
+ color: var(--gd-palette-complementary-8);
40
+ }
41
+ }
29
42
  }
30
43
  }
31
44
 
@@ -0,0 +1,53 @@
1
+ // (C) 2026 GoodData Corporation
2
+
3
+ .gd-ui-kit-restricted-placeholder {
4
+ display: flex;
5
+ flex-direction: column;
6
+ align-items: center;
7
+ justify-content: center;
8
+ width: 100%;
9
+ height: 100%;
10
+ padding: 0 var(--gd-spacing-20px);
11
+ box-sizing: border-box;
12
+ overflow: hidden;
13
+ color: var(--gd-palette-complementary-7);
14
+ text-align: center;
15
+ -webkit-font-smoothing: antialiased;
16
+ -moz-osx-font-smoothing: grayscale;
17
+
18
+ &__content {
19
+ display: flex;
20
+ flex-direction: column;
21
+ align-items: center;
22
+ gap: var(--gd-spacing-5px);
23
+ // the reason survives a tile too short for the rest, rather than being centred out of it
24
+ min-height: 0;
25
+
26
+ &:focus-visible {
27
+ outline: 2px solid var(--gd-palette-primary-base);
28
+ outline-offset: var(--gd-spacing-5px);
29
+ }
30
+ }
31
+
32
+ &__text {
33
+ display: flex;
34
+ flex-direction: column;
35
+ align-items: center;
36
+ }
37
+
38
+ &__title {
39
+ margin: 0;
40
+ color: inherit;
41
+ font-size: 14px;
42
+ font-weight: 700;
43
+ line-height: 23px;
44
+ }
45
+
46
+ &__description {
47
+ margin: 0;
48
+ color: inherit;
49
+ font-size: 14px;
50
+ font-weight: 400;
51
+ line-height: 23px;
52
+ }
53
+ }
@@ -34,6 +34,7 @@
34
34
  @use "./UiBreadcrumb/UiBreadcrumb.scss";
35
35
  @use "./UiInlineTextGenerator/UiInlineTextGenerator.scss";
36
36
  @use "./UiErrorPage/UiErrorPage.scss";
37
+ @use "./UiRestrictedPlaceholder/UiRestrictedPlaceholder.scss";
37
38
  @use "./UiSectionHeading/UiSectionHeading.scss";
38
39
  @use "./UiConfirmDialog/UiConfirmDialog.scss";
39
40
  @use "./UiTextInput/UiTextInput.scss";
@@ -3771,6 +3771,52 @@
3771
3771
  line-height: 23px;
3772
3772
  }
3773
3773
 
3774
+ .gd-ui-kit-restricted-placeholder {
3775
+ display: flex;
3776
+ flex-direction: column;
3777
+ align-items: center;
3778
+ justify-content: center;
3779
+ width: 100%;
3780
+ height: 100%;
3781
+ padding: 0 var(--gd-spacing-20px);
3782
+ box-sizing: border-box;
3783
+ overflow: hidden;
3784
+ color: var(--gd-palette-complementary-7);
3785
+ text-align: center;
3786
+ -webkit-font-smoothing: antialiased;
3787
+ -moz-osx-font-smoothing: grayscale;
3788
+ }
3789
+ .gd-ui-kit-restricted-placeholder__content {
3790
+ display: flex;
3791
+ flex-direction: column;
3792
+ align-items: center;
3793
+ gap: var(--gd-spacing-5px);
3794
+ min-height: 0;
3795
+ }
3796
+ .gd-ui-kit-restricted-placeholder__content:focus-visible {
3797
+ outline: 2px solid var(--gd-palette-primary-base);
3798
+ outline-offset: var(--gd-spacing-5px);
3799
+ }
3800
+ .gd-ui-kit-restricted-placeholder__text {
3801
+ display: flex;
3802
+ flex-direction: column;
3803
+ align-items: center;
3804
+ }
3805
+ .gd-ui-kit-restricted-placeholder__title {
3806
+ margin: 0;
3807
+ color: inherit;
3808
+ font-size: 14px;
3809
+ font-weight: 700;
3810
+ line-height: 23px;
3811
+ }
3812
+ .gd-ui-kit-restricted-placeholder__description {
3813
+ margin: 0;
3814
+ color: inherit;
3815
+ font-size: 14px;
3816
+ font-weight: 400;
3817
+ line-height: 23px;
3818
+ }
3819
+
3774
3820
  .gd-ui-kit-section-heading {
3775
3821
  display: flex;
3776
3822
  align-items: center;
@@ -4068,6 +4114,16 @@
4068
4114
  border-radius: var(--gd-modal-borderRadius);
4069
4115
  box-shadow: 0 2px 8px var(--gd-shadow-color);
4070
4116
  }
4117
+ .gd-ui-kit-modal-dialog__card--variant-confirmation {
4118
+ box-sizing: border-box;
4119
+ border: 1px solid var(--gd-modal-borderColor);
4120
+ }
4121
+ .gd-ui-kit-modal-dialog__card--variant-confirmation .gd-ui-kit-dialog-header__title {
4122
+ color: var(--gd-modal-title-color);
4123
+ }
4124
+ .gd-ui-kit-modal-dialog__card--variant-confirmation .gd-ui-kit-dialog-body {
4125
+ color: var(--gd-palette-complementary-8);
4126
+ }
4071
4127
 
4072
4128
  .gd-ui-kit-dialog-header {
4073
4129
  display: flex;
@@ -14445,12 +14501,10 @@ input[type=search]::-webkit-search-cancel-button {
14445
14501
  }
14446
14502
  .gd-rich-text-content .gd-rich-text-metric-restricted {
14447
14503
  display: inline-flex;
14448
- align-items: baseline;
14449
- gap: 4px;
14450
- color: var(--gd-palette-complementary-6, #94a1ad);
14451
- }
14452
- .gd-rich-text-content .gd-rich-text-metric-restricted::before {
14453
- font-size: 12px;
14504
+ align-items: center;
14505
+ gap: 2px;
14506
+ color: var(--gd-palette-complementary-6);
14507
+ font-weight: 400;
14454
14508
  }
14455
14509
 
14456
14510
  .gd-rich-text-content-view * {