@gooddata/sdk-ui-kit 10.17.0-alpha.0 → 10.17.0-alpha.10

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 (133) hide show
  1. package/esm/@ui/@dev/CodeSnippet.d.ts +11 -0
  2. package/esm/@ui/@dev/CodeSnippet.d.ts.map +1 -0
  3. package/esm/@ui/@dev/CodeSnippet.js +30 -0
  4. package/esm/@ui/@dev/CodeSnippet.js.map +1 -0
  5. package/esm/@ui/@dev/ComponentTable.d.ts +61 -0
  6. package/esm/@ui/@dev/ComponentTable.d.ts.map +1 -0
  7. package/esm/@ui/@dev/ComponentTable.js +88 -0
  8. package/esm/@ui/@dev/ComponentTable.js.map +1 -0
  9. package/esm/@ui/@types/icon.d.ts +5 -0
  10. package/esm/@ui/@types/icon.d.ts.map +1 -0
  11. package/esm/@ui/@types/icon.js +3 -0
  12. package/esm/@ui/@types/icon.js.map +1 -0
  13. package/esm/@ui/@types/size.d.ts +13 -0
  14. package/esm/@ui/@types/size.d.ts.map +1 -0
  15. package/esm/@ui/@types/size.js +2 -0
  16. package/esm/@ui/@types/size.js.map +1 -0
  17. package/esm/@ui/@types/themeColors.d.ts +5 -0
  18. package/esm/@ui/@types/themeColors.d.ts.map +1 -0
  19. package/esm/@ui/@types/themeColors.js +3 -0
  20. package/esm/@ui/@types/themeColors.js.map +1 -0
  21. package/esm/@ui/@types/variant.d.ts +21 -0
  22. package/esm/@ui/@types/variant.d.ts.map +1 -0
  23. package/esm/@ui/@types/variant.js +2 -0
  24. package/esm/@ui/@types/variant.js.map +1 -0
  25. package/esm/@ui/@utils/bem.d.ts +100 -0
  26. package/esm/@ui/@utils/bem.d.ts.map +1 -0
  27. package/esm/@ui/@utils/bem.js +112 -0
  28. package/esm/@ui/@utils/bem.js.map +1 -0
  29. package/esm/@ui/UiButton/UiButton.d.ts +23 -0
  30. package/esm/@ui/UiButton/UiButton.d.ts.map +1 -0
  31. package/esm/@ui/UiButton/UiButton.js +18 -0
  32. package/esm/@ui/UiButton/UiButton.js.map +1 -0
  33. package/esm/@ui/UiIcon/UiIcon.d.ts +17 -0
  34. package/esm/@ui/UiIcon/UiIcon.d.ts.map +1 -0
  35. package/esm/@ui/UiIcon/UiIcon.js +13 -0
  36. package/esm/@ui/UiIcon/UiIcon.js.map +1 -0
  37. package/esm/@ui/UiIcon/iconBem.d.ts +2 -0
  38. package/esm/@ui/UiIcon/iconBem.d.ts.map +1 -0
  39. package/esm/@ui/UiIcon/iconBem.js +4 -0
  40. package/esm/@ui/UiIcon/iconBem.js.map +1 -0
  41. package/esm/@ui/UiIcon/icons.d.ts +8 -0
  42. package/esm/@ui/UiIcon/icons.d.ts.map +1 -0
  43. package/esm/@ui/UiIcon/icons.js +18 -0
  44. package/esm/@ui/UiIcon/icons.js.map +1 -0
  45. package/esm/Bubble/Bubble.js +1 -1
  46. package/esm/Bubble/Bubble.js.map +1 -1
  47. package/esm/Header/Header.js +1 -1
  48. package/esm/Header/Header.js.map +1 -1
  49. package/esm/Icon/Icon.d.ts +1 -1
  50. package/esm/Icon/Icon.d.ts.map +1 -1
  51. package/esm/Icon/Icon.js +3 -1
  52. package/esm/Icon/Icon.js.map +1 -1
  53. package/esm/Icon/icons/Header.d.ts +7 -0
  54. package/esm/Icon/icons/Header.d.ts.map +1 -0
  55. package/esm/Icon/icons/Header.js +12 -0
  56. package/esm/Icon/icons/Header.js.map +1 -0
  57. package/esm/RichText/RichText.d.ts +5 -0
  58. package/esm/RichText/RichText.d.ts.map +1 -1
  59. package/esm/RichText/RichText.js +26 -5
  60. package/esm/RichText/RichText.js.map +1 -1
  61. package/esm/RichText/RichTextWithTooltip.d.ts.map +1 -1
  62. package/esm/RichText/RichTextWithTooltip.js +3 -3
  63. package/esm/RichText/RichTextWithTooltip.js.map +1 -1
  64. package/esm/SettingWidget/StylingSettingWidget/utils.js +1 -1
  65. package/esm/SettingWidget/StylingSettingWidget/utils.js.map +1 -1
  66. package/esm/Typography/Typography.d.ts +5 -1
  67. package/esm/Typography/Typography.d.ts.map +1 -1
  68. package/esm/Typography/Typography.js +1 -1
  69. package/esm/Typography/Typography.js.map +1 -1
  70. package/esm/Typography/index.d.ts +1 -1
  71. package/esm/Typography/index.d.ts.map +1 -1
  72. package/esm/index.d.ts +15 -0
  73. package/esm/index.d.ts.map +1 -1
  74. package/esm/index.js +7 -0
  75. package/esm/index.js.map +1 -1
  76. package/esm/sdk-ui-kit.d.ts +186 -2
  77. package/package.json +15 -11
  78. package/src/@ui/UiButton/UiButton.scss +319 -0
  79. package/src/@ui/UiIcon/UiIcon.scss +61 -0
  80. package/src/@ui/defaultTheme.scss +222 -0
  81. package/src/@ui/index.scss +4 -0
  82. package/styles/css/bubble.css +42 -42
  83. package/styles/css/bubble.css.map +1 -1
  84. package/styles/css/button.css +27 -27
  85. package/styles/css/button.css.map +1 -1
  86. package/styles/css/datepicker.css +4 -4
  87. package/styles/css/descriptionPanel.css +3 -3
  88. package/styles/css/dialog.css +5 -4
  89. package/styles/css/dialog.css.map +1 -1
  90. package/styles/css/dropdown.css +4 -4
  91. package/styles/css/embedInsightDialog.css +1 -1
  92. package/styles/css/form.css +18 -18
  93. package/styles/css/form.css.map +1 -1
  94. package/styles/css/header.css +17 -17
  95. package/styles/css/header.css.map +1 -1
  96. package/styles/css/hyperlink.css +1 -1
  97. package/styles/css/insightList.css +2 -2
  98. package/styles/css/list.css +1 -1
  99. package/styles/css/loadingDots.css +1 -1
  100. package/styles/css/main.css +600 -139
  101. package/styles/css/main.css.map +1 -1
  102. package/styles/css/menu.css +1 -1
  103. package/styles/css/messages.css +1 -1
  104. package/styles/css/overlay.css +1 -1
  105. package/styles/css/settingWidget.css +1 -1
  106. package/styles/css/shareDialog.css +4 -4
  107. package/styles/css/shareDialogSelectControl.css +2 -2
  108. package/styles/css/stylingEditorDialog.css +1 -1
  109. package/styles/css/syntaxHighlightingInput.css +1 -1
  110. package/styles/css/tabs.css +1 -1
  111. package/styles/css/typo.css +2 -2
  112. package/styles/css/typo.css.map +1 -1
  113. package/styles/scss/Bubble/_variables.scss +8 -5
  114. package/styles/scss/Button/_variables.scss +20 -11
  115. package/styles/scss/Dialog/_variables.scss +3 -3
  116. package/styles/scss/button.scss +1 -1
  117. package/styles/scss/datepicker.scss +5 -5
  118. package/styles/scss/dialog.scss +4 -2
  119. package/styles/scss/dropdown.scss +4 -4
  120. package/styles/scss/embedInsightDialog.scss +2 -2
  121. package/styles/scss/form.scss +11 -10
  122. package/styles/scss/header.scss +23 -17
  123. package/styles/scss/insightList.scss +1 -1
  124. package/styles/scss/list.scss +2 -2
  125. package/styles/scss/loadingDots.scss +2 -2
  126. package/styles/scss/main.scss +3 -0
  127. package/styles/scss/overlay.scss +2 -2
  128. package/styles/scss/shareDialog.scss +6 -6
  129. package/styles/scss/shareDialogSelectControl.scss +2 -2
  130. package/styles/scss/syntaxHighlightingInput.scss +2 -2
  131. package/styles/scss/tabs.scss +2 -2
  132. package/styles/scss/typo-mixins.scss +2 -2
  133. package/styles/scss/variables.scss +6 -6
@@ -129,6 +129,54 @@ export declare class AutoSize extends Component<IAutoSizeProps> {
129
129
  */
130
130
  export declare const BackButton: React_2.FC<IBackButtonProps>;
131
131
 
132
+ /**
133
+ * Utility function for creating BEM class names in \@gooddata/sdk-ui-kit.
134
+ * If you need to use BEM in other libraries, see this function implementation.
135
+ *
136
+ * - b(props) - creates a class names for BEM block
137
+ * - e(element, props) - creates a class name for BEM element
138
+ *
139
+ * Example usage:
140
+ *
141
+ * const \{ b, e \} = bem("gd-ui-button");
142
+ *
143
+ * b(\{ size: "large" \}) === "gd-ui-button gd-ui-button--size-large"
144
+ *
145
+ * b(\{ isSelected: true \}) === "gd-ui-button gd-ui-button--isSelected"
146
+ *
147
+ * e("icon", \{ size: "large" \}) === "gd-ui-button__icon gd-ui-button__icon--size-large"
148
+ *
149
+ * e("icon", \{ isDisabled: true \}) === "gd-ui-button__icon gd-ui-button__icon--isDisabled"
150
+ *
151
+ * @internal
152
+ */
153
+ export declare const bem: (block: `gd-ui-kit-${string}`) => {
154
+ /**
155
+ * Creates a class names for BEM block.
156
+ *
157
+ * Example usage:
158
+ *
159
+ * const \{ b, e \} = bem("gd-ui-button");
160
+ *
161
+ * b(\{ size: "large" \}) === "gd-ui-button gd-ui-button--size-large"
162
+ *
163
+ * b(\{ isSelected: true \}) === "gd-ui-button gd-ui-button--isSelected"
164
+ */
165
+ b: (props?: StyleProps) => string;
166
+ /**
167
+ * Creates a class name for BEM element.
168
+ *
169
+ * Example usage:
170
+ *
171
+ * const \{ b, e \} = bem("gd-ui-button");
172
+ *
173
+ * e("icon", \{ size: "large" \}) === "gd-ui-button__icon gd-ui-button__icon--size-large"
174
+ *
175
+ * e("icon", \{ isDisabled: true \}) === "gd-ui-button__icon gd-ui-button__icon--isDisabled"
176
+ */
177
+ e: (element: string, props?: StyleProps) => string;
178
+ };
179
+
132
180
  /**
133
181
  * @internal
134
182
  */
@@ -343,6 +391,11 @@ export declare const CommunityEditionDialog: React_2.FC<ICommunityEditionDialogP
343
391
  */
344
392
  export declare const ComponentLabelsProvider: React_2.FC<IComponentLabelsProviderProps>;
345
393
 
394
+ /**
395
+ * @internal
396
+ */
397
+ export declare function ComponentTable<TProps extends object, TProp extends keyof TProps>({ Component, columnsBy, rowsBy, baseProps, debug, codeSnippet, cellWidth, cellHeight, align, }: IComponentTableProps<TProps, TProp>): React_2.JSX.Element;
398
+
346
399
  /**
347
400
  * @internal
348
401
  */
@@ -1378,7 +1431,22 @@ export declare type IComponentLabelsProviderProps = {
1378
1431
  /**
1379
1432
  * @internal
1380
1433
  */
1381
- export declare const Icon: Record<string, React.FC<IIconProps>>;
1434
+ export declare interface IComponentTableProps<TProps extends object, TProp extends keyof TProps> {
1435
+ columnsBy: IPropCombination<TProps, TProp>;
1436
+ rowsBy: IPropCombination<TProps, TProp>[];
1437
+ baseProps?: Partial<TProps>;
1438
+ Component: React_2.ComponentType<TProps>;
1439
+ codeSnippet?: string;
1440
+ debug?: boolean;
1441
+ cellWidth?: number;
1442
+ cellHeight?: number;
1443
+ align?: "center" | "flex-start";
1444
+ }
1445
+
1446
+ /**
1447
+ * @internal
1448
+ */
1449
+ export declare const Icon: Record<string, React_2.FC<IIconProps>>;
1382
1450
 
1383
1451
  /**
1384
1452
  * @internal
@@ -1401,6 +1469,11 @@ export declare interface IConfirmDialogBaseProps extends IDialogBaseProps {
1401
1469
  titleRightIconRenderer?: () => JSX.Element;
1402
1470
  }
1403
1471
 
1472
+ /**
1473
+ * @internal
1474
+ */
1475
+ export declare type IconType = "check" | "plus" | "sync";
1476
+
1404
1477
  /**
1405
1478
  * @internal
1406
1479
  */
@@ -3309,6 +3382,15 @@ export declare interface IPositioning {
3309
3382
  offset?: IOffset;
3310
3383
  }
3311
3384
 
3385
+ /**
3386
+ * @internal
3387
+ */
3388
+ export declare interface IPropCombination<TProps extends object, TProp extends keyof TProps> {
3389
+ prop: TProp;
3390
+ values: TProps[TProp][];
3391
+ baseProps?: Partial<TProps>;
3392
+ }
3393
+
3312
3394
  /**
3313
3395
  * @internal
3314
3396
  */
@@ -3422,6 +3504,11 @@ export declare interface IRichTextProps {
3422
3504
  editRows?: number;
3423
3505
  emptyElement?: JSX.Element;
3424
3506
  className?: string;
3507
+ /**
3508
+ * If provided, the textarea starts at just 1 row,
3509
+ * resizing dynamically up to editRows value.
3510
+ */
3511
+ autoResize?: boolean;
3425
3512
  }
3426
3513
 
3427
3514
  /**
@@ -3979,7 +4066,7 @@ export declare interface IToggleButtonProps {
3979
4066
  * @internal
3980
4067
  */
3981
4068
  export declare interface ITypographyProps {
3982
- tagName: "h1" | "h2" | "h3" | "p";
4069
+ tagName: TypographyTagName;
3983
4070
  children: React_2.ReactNode;
3984
4071
  className?: string;
3985
4072
  onClick?: (e: React_2.MouseEvent) => void;
@@ -4415,6 +4502,11 @@ export declare enum PresetType {
4415
4502
  CUSTOM_FORMAT = "customFormat"
4416
4503
  }
4417
4504
 
4505
+ /**
4506
+ * @internal
4507
+ */
4508
+ export declare function propCombinationsFor<TProps extends object>(baseProps: TProps): <TProp extends keyof TProps>(prop: TProp, values: TProps[TProp][], additionalProps?: Partial<TProps>) => IPropCombination<TProps, TProp>;
4509
+
4418
4510
  /**
4419
4511
  * @internal
4420
4512
  */
@@ -4651,6 +4743,21 @@ export declare class SingleSelectListItem extends Component<ISingleSelectListIte
4651
4743
  */
4652
4744
  export declare type SingleSelectListItemType = "header" | "separator";
4653
4745
 
4746
+ /**
4747
+ * @internal
4748
+ */
4749
+ export declare type SizeLarge = "large";
4750
+
4751
+ /**
4752
+ * @internal
4753
+ */
4754
+ export declare type SizeMedium = "medium";
4755
+
4756
+ /**
4757
+ * @internal
4758
+ */
4759
+ export declare type SizeSmall = "small";
4760
+
4654
4761
  /**
4655
4762
  * @internal
4656
4763
  */
@@ -4700,6 +4807,13 @@ export declare class Spinner extends PureComponent<ISpinnerProps> {
4700
4807
  */
4701
4808
  export declare type SpinnerSize = "large" | "small";
4702
4809
 
4810
+ /**
4811
+ * Properties for BEM modifiers.
4812
+ *
4813
+ * @internal
4814
+ */
4815
+ export declare type StyleProps = Record<string, string | boolean>;
4816
+
4703
4817
  /**
4704
4818
  * @internal
4705
4819
  */
@@ -4800,6 +4914,11 @@ export declare class TextAreaWithSubmit extends Component<ITextAreaWithSubmitPro
4800
4914
  render(): ReactNode;
4801
4915
  }
4802
4916
 
4917
+ /**
4918
+ * @internal
4919
+ */
4920
+ export declare type ThemeColor = "primary" | "warning" | "error" | "complementary-0" | "complementary-1" | "complementary-2" | "complementary-3" | "complementary-4" | "complementary-5" | "complementary-6" | "complementary-7" | "complementary-8" | "complementary-9";
4921
+
4803
4922
  /**
4804
4923
  * @internal
4805
4924
  */
@@ -4860,6 +4979,46 @@ export declare type TUTMContent = "main_menu_help_documentation" | "main_menu_he
4860
4979
  */
4861
4980
  export declare const Typography: React_2.FC<ITypographyProps>;
4862
4981
 
4982
+ /**
4983
+ * @internal
4984
+ */
4985
+ export declare type TypographyTagName = "h1" | "h2" | "h3" | "p";
4986
+
4987
+ /**
4988
+ * @internal
4989
+ */
4990
+ export declare const UiButton: ({ size, variant, label, isDisabled, isLoading, iconBefore, iconAfter, }: UiButtonProps) => React_2.JSX.Element;
4991
+
4992
+ /**
4993
+ * @internal
4994
+ */
4995
+ export declare interface UiButtonProps {
4996
+ size?: SizeSmall | SizeMedium | SizeLarge;
4997
+ variant?: VariantPrimary | VariantSecondary | VariantTertiary | VariantPopOut | VariantDanger;
4998
+ iconBefore?: IconType;
4999
+ iconAfter?: IconType;
5000
+ label: string;
5001
+ isDisabled?: boolean;
5002
+ isLoading?: boolean;
5003
+ tooltip?: React_2.ReactNode;
5004
+ onClick?: () => void;
5005
+ }
5006
+
5007
+ /**
5008
+ * @internal
5009
+ */
5010
+ export declare const UiIcon: ({ type, label, color, size }: UiIconProps) => React_2.JSX.Element;
5011
+
5012
+ /**
5013
+ * @internal
5014
+ */
5015
+ export declare interface UiIconProps {
5016
+ type: IconType;
5017
+ color?: ThemeColor;
5018
+ label: string;
5019
+ size?: number;
5020
+ }
5021
+
4863
5022
  /**
4864
5023
  * @internal
4865
5024
  */
@@ -4980,6 +5139,31 @@ export declare interface UseToastMessageType {
4980
5139
  removeAllMessages: () => void;
4981
5140
  }
4982
5141
 
5142
+ /**
5143
+ * @internal
5144
+ */
5145
+ export declare type VariantDanger = "danger";
5146
+
5147
+ /**
5148
+ * @internal
5149
+ */
5150
+ export declare type VariantPopOut = "popout";
5151
+
5152
+ /**
5153
+ * @internal
5154
+ */
5155
+ export declare type VariantPrimary = "primary";
5156
+
5157
+ /**
5158
+ * @internal
5159
+ */
5160
+ export declare type VariantSecondary = "secondary";
5161
+
5162
+ /**
5163
+ * @internal
5164
+ */
5165
+ export declare type VariantTertiary = "tertiary";
5166
+
4983
5167
  /**
4984
5168
  * @internal
4985
5169
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gooddata/sdk-ui-kit",
3
- "version": "10.17.0-alpha.0",
3
+ "version": "10.17.0-alpha.10",
4
4
  "description": "GoodData SDK - UI Building Components",
5
5
  "repository": {
6
6
  "type": "git",
@@ -30,6 +30,7 @@
30
30
  "esm/**/*.d.ts",
31
31
  "esm/**/*.map",
32
32
  "esm/**/*.svg",
33
+ "src/**/*.scss",
33
34
  "styles"
34
35
  ],
35
36
  "dependencies": {
@@ -62,11 +63,11 @@
62
63
  "ts-invariant": "^0.7.5",
63
64
  "tslib": "^2.5.0",
64
65
  "uuid": "^8.3.2",
65
- "@gooddata/sdk-backend-spi": "10.17.0-alpha.0",
66
- "@gooddata/sdk-model": "10.17.0-alpha.0",
67
- "@gooddata/sdk-ui": "10.17.0-alpha.0",
68
- "@gooddata/sdk-ui-theme-provider": "10.17.0-alpha.0",
69
- "@gooddata/util": "10.17.0-alpha.0"
66
+ "@gooddata/sdk-backend-spi": "10.17.0-alpha.10",
67
+ "@gooddata/sdk-ui": "10.17.0-alpha.10",
68
+ "@gooddata/sdk-model": "10.17.0-alpha.10",
69
+ "@gooddata/sdk-ui-theme-provider": "10.17.0-alpha.10",
70
+ "@gooddata/util": "10.17.0-alpha.10"
70
71
  },
71
72
  "peerDependencies": {
72
73
  "react": "^16.10.0 || ^17.0.0 || ^18.0.0",
@@ -125,8 +126,8 @@
125
126
  "typescript": "5.3.3",
126
127
  "vitest": "1.0.4",
127
128
  "vitest-dom": "0.1.1",
128
- "@gooddata/reference-workspace": "10.17.0-alpha.0",
129
- "@gooddata/sdk-backend-mockingbird": "10.17.0-alpha.0"
129
+ "@gooddata/reference-workspace": "10.17.0-alpha.10",
130
+ "@gooddata/sdk-backend-mockingbird": "10.17.0-alpha.10"
130
131
  },
131
132
  "scripts": {
132
133
  "clean": "rm -rf ci dist esm coverage styles/css *.log tsconfig.tsbuildinfo",
@@ -138,15 +139,18 @@
138
139
  "eslint": "eslint -c .eslintrc.cjs src/",
139
140
  "eslint-fix": "eslint -c .eslintrc.cjs src/ --fix",
140
141
  "eslint-ci": "mkdir -p ./ci/results && eslint -f checkstyle -o ci/results/eslint-results.xml -c .eslintrc.cjs src/",
142
+ "generate-theme": "node scripts/generateDefaultThemeScss.js && prettier --write ./src/@ui/defaultTheme.scss",
141
143
  "prettier-check": "prettier --check '{src,styles,__mocks__}/**/*.{ts,tsx,json,scss,md,yaml,html}'",
142
144
  "prettier-write": "prettier --write '{src,styles,__mocks__}/**/*.{ts,tsx,json,scss,md,yaml,html}'",
143
145
  "dep-cruiser": "depcruise --validate .dependency-cruiser.cjs --output-type err-long src/",
144
146
  "dep-cruiser-ci": "depcruise --validate .dependency-cruiser.cjs --output-type err-long src/",
145
147
  "stylelint": "stylelint '**/*.scss'",
146
148
  "stylelint-ci": "stylelint '**/*.scss' --custom-formatter=node_modules/stylelint-checkstyle-formatter > ./ci/results/stylelint-results.xml",
147
- "validate": "npm run dep-cruiser && npm run eslint && npm run stylelint && npm run validate-locales && npm run prettier-check",
148
- "validate-ci": "npm run dep-cruiser-ci && npm run eslint-ci && npm run stylelint-ci && npm run validate-locales-ci && npm run prettier-check",
149
+ "validate": "npm run dep-cruiser && npm run eslint && npm run stylelint && npm run validate-locales && npm run prettier-check && npm run validate-theming",
150
+ "validate-ci": "npm run dep-cruiser-ci && npm run eslint-ci && npm run stylelint-ci && npm run validate-locales-ci && npm run prettier-check && npm run validate-theming",
149
151
  "validate-locales": "cd ../sdk-ui && npm run validate-locales",
150
- "validate-locales-ci": "cd ../sdk-ui && npm run validate-locales-ci"
152
+ "validate-locales-ci": "cd ../sdk-ui && npm run validate-locales-ci",
153
+ "validate-theming": "npm run scss && node scripts/validateCss.js",
154
+ "scss": "sass --load-path=node_modules --load-path=node_modules/fixed-data-table-2/dist --load-path=node_modules/codemirror/lib styles/scss:styles/css"
151
155
  }
152
156
  }
@@ -0,0 +1,319 @@
1
+ // (C) 2024 GoodData Corporation
2
+
3
+ .gd-ui-kit-button {
4
+ $root: &;
5
+
6
+ font-family: var(--gd-font-family);
7
+ gap: var(--gd-spacing-5px);
8
+ border-radius: var(--gd-button-borderRadius);
9
+ transition: var(--gd-transition-all);
10
+ display: inline-flex;
11
+ justify-content: center;
12
+ align-items: center;
13
+ cursor: pointer;
14
+ border-style: solid;
15
+ border-width: 1px;
16
+
17
+ &:disabled {
18
+ cursor: default;
19
+ }
20
+
21
+ &:not(&:disabled, &--variant-tertiary, &--variant-popout) {
22
+ &:active {
23
+ #{$root}__text {
24
+ // Move text inside the button on :active state.
25
+ padding-top: 1px;
26
+ }
27
+
28
+ #{$root}__icon {
29
+ // Move icon inside the button on :active state.
30
+ padding-top: 1px;
31
+ }
32
+ }
33
+ }
34
+
35
+ &__text {
36
+ transition: var(--gd-transition-all);
37
+ }
38
+
39
+ &__icon {
40
+ display: flex;
41
+ align-items: center;
42
+ justify-content: center;
43
+ transition: var(--gd-transition-all);
44
+ }
45
+
46
+ &--isLoading {
47
+ #{$root}__icon {
48
+ // Spin icon on loading state.
49
+ animation: rotate 1s infinite steps(30);
50
+ }
51
+ }
52
+
53
+ /**
54
+ * Size
55
+ */
56
+ &--size {
57
+ &-small {
58
+ height: var(--gd-button-S);
59
+ padding: var(--gd-spacing-6px) var(--gd-spacing-10px);
60
+ font-size: 14px;
61
+
62
+ &#{$root}--iconPosition {
63
+ &-left {
64
+ padding-left: var(--gd-spacing-7px);
65
+ }
66
+
67
+ &-right {
68
+ padding-right: var(--gd-spacing-7px);
69
+ }
70
+ }
71
+ }
72
+
73
+ &-medium {
74
+ height: var(--gd-button-M);
75
+ padding: var(--gd-spacing-6px) var(--gd-spacing-15px);
76
+ font-size: 14px;
77
+
78
+ &#{$root}--iconPosition {
79
+ &-left {
80
+ padding-left: var(--gd-spacing-10px);
81
+ }
82
+
83
+ &-right {
84
+ padding-right: var(--gd-spacing-10px);
85
+ }
86
+ }
87
+ }
88
+
89
+ &-large {
90
+ height: var(--gd-button-L);
91
+ padding: var(--gd-spacing-6px) var(--gd-spacing-20px);
92
+ font-size: 16px;
93
+
94
+ &#{$root}--iconPosition {
95
+ &-left {
96
+ padding-left: var(--gd-spacing-15px);
97
+ }
98
+
99
+ &-right {
100
+ padding-right: var(--gd-spacing-15px);
101
+ }
102
+ }
103
+ }
104
+ }
105
+
106
+ /**
107
+ * Variant
108
+ */
109
+ &--variant {
110
+ &-primary {
111
+ --gd-icon-fill-color: var(--gd-palette-complementary-0);
112
+
113
+ color: var(--gd-palette-complementary-0);
114
+ background-color: var(--gd-palette-primary-base);
115
+ border-color: var(--gd-palette-complementary-9-t90);
116
+ font-weight: 700;
117
+
118
+ &:not(&:disabled) {
119
+ &:focus {
120
+ box-shadow: var(--gd-button-dropShadow, 0 -2px 0 0) var(--gd-palette-complementary-9-t85)
121
+ inset;
122
+ }
123
+
124
+ &:hover {
125
+ background-color: var(--gd-palette-primary-base-d06);
126
+ box-shadow: var(--gd-button-dropShadow, 0 -2px 0 0) var(--gd-palette-complementary-9-t85)
127
+ inset;
128
+ }
129
+
130
+ &:active {
131
+ background: var(--gd-palette-primary-base-d12);
132
+ box-shadow: var(--gd-button-dropShadow, 0 2px 0 0) var(--gd-palette-complementary-9-t85)
133
+ inset;
134
+ }
135
+ }
136
+
137
+ &:disabled {
138
+ background-color: var(--gd-palette-primary-disabled);
139
+ box-shadow: none;
140
+ border-color: transparent;
141
+ }
142
+ }
143
+
144
+ &-secondary {
145
+ --gd-icon-fill-color: var(--gd-palette-complementary-5);
146
+
147
+ color: var(--gd-palette-complementary-7);
148
+ border-color: var(--gd-palette-complementary-4);
149
+ background-color: var(--gd-palette-complementary-0);
150
+ font-weight: 400;
151
+
152
+ &:not(&:disabled) {
153
+ &:focus {
154
+ --gd-icon-fill-color: var(--gd-palette-primary-base);
155
+
156
+ color: var(--gd-palette-complementary-8);
157
+ background: var(--gd-palette-complementary-1);
158
+ box-shadow: var(--gd-button-dropShadow, 0 -2px 0 0) var(--gd-palette-complementary-5-t40)
159
+ inset;
160
+ }
161
+
162
+ &:hover {
163
+ --gd-icon-fill-color: var(--gd-palette-primary-base);
164
+
165
+ color: var(--gd-palette-complementary-8);
166
+ border-color: var(--gd-palette-complementary-5);
167
+ background: var(--gd-palette-complementary-0);
168
+ box-shadow: var(--gd-button-dropShadow, 0 -2px 0 0) var(--gd-palette-complementary-5-t40)
169
+ inset;
170
+ }
171
+
172
+ &:active {
173
+ --gd-icon-fill-color: var(--gd-palette-primary-base);
174
+
175
+ color: var(--gd-palette-complementary-8);
176
+ border-color: var(--gd-palette-complementary-5);
177
+ background: var(--gd-palette-complementary-3);
178
+ box-shadow: var(--gd-button-dropShadow, 0 2px 0 0) var(--gd-palette-complementary-9-t85)
179
+ inset;
180
+ }
181
+ }
182
+
183
+ &:disabled {
184
+ color: var(--gd-palette-complementary-5);
185
+ border-color: var(--gd-palette-complementary-4);
186
+ background: var(--gd-palette-complementary-0);
187
+ box-shadow: none;
188
+ }
189
+ }
190
+
191
+ &-tertiary {
192
+ --gd-icon-fill-color: var(--gd-palette-complementary-5);
193
+
194
+ color: var(--gd-palette-complementary-7);
195
+ text-decoration: underline;
196
+ background-color: transparent;
197
+ border-color: transparent;
198
+
199
+ &:not(&:disabled) {
200
+ &:focus {
201
+ --gd-icon-fill-color: var(--gd-palette-primary-base);
202
+
203
+ color: var(--gd-palette-complementary-8);
204
+ }
205
+ &:hover {
206
+ --gd-icon-fill-color: var(--gd-palette-primary-base);
207
+
208
+ color: var(--gd-palette-complementary-8);
209
+ }
210
+ &:active {
211
+ --gd-icon-fill-color: var(--gd-palette-primary-base);
212
+
213
+ color: var(--gd-palette-complementary-8);
214
+ }
215
+ }
216
+
217
+ &:disabled {
218
+ color: var(--gd-palette-complementary-5);
219
+ text-decoration: none;
220
+ }
221
+
222
+ &#{$root}--size {
223
+ &-small,
224
+ &-medium {
225
+ padding: var(--gd-spacing-6px) var(--gd-spacing-5px);
226
+ }
227
+
228
+ &-large {
229
+ padding: var(--gd-spacing-6px) var(--gd-spacing-10px);
230
+ }
231
+ }
232
+ }
233
+
234
+ &-popout {
235
+ --gd-icon-fill-color: var(--gd-palette-primary-base);
236
+
237
+ color: var(--gd-palette-primary-base);
238
+ background-color: transparent;
239
+ border-color: transparent;
240
+
241
+ &:not(&:disabled) {
242
+ &:focus {
243
+ text-decoration: underline;
244
+ }
245
+
246
+ &:hover {
247
+ color: var(--gd-palette-complementary-8);
248
+ text-decoration: underline;
249
+ }
250
+
251
+ &:active {
252
+ color: var(--gd-palette-primary-base);
253
+ text-decoration: underline;
254
+ }
255
+ }
256
+
257
+ &:disabled {
258
+ color: var(--gd-palette-complementary-5);
259
+ }
260
+
261
+ &#{$root}--size {
262
+ &-small,
263
+ &-medium {
264
+ padding: var(--gd-spacing-6px) var(--gd-spacing-5px);
265
+ }
266
+
267
+ &-large {
268
+ padding: var(--gd-spacing-6px) var(--gd-spacing-10px);
269
+ }
270
+ }
271
+ }
272
+
273
+ &-danger {
274
+ --gd-icon-fill-color: var(--gd-palette-complementary-0);
275
+
276
+ background: var(--gd-palette-error-base);
277
+ color: var(--gd-palette-complementary-0);
278
+ border-color: var(--gd-palette-complementary-9-t90);
279
+ font-weight: 700;
280
+
281
+ &:not(&:disabled) {
282
+ &:focus {
283
+ border-color: var(--gd-palette-complementary-9-t80);
284
+ box-shadow: var(--gd-button-dropShadow, 0 -2px 0 0) var(--gd-palette-complementary-9-t85)
285
+ inset;
286
+ }
287
+
288
+ &:hover {
289
+ border-color: var(--gd-palette-complementary-9-t80);
290
+ background-color: var(--gd-palette-error-base-d10);
291
+ box-shadow: var(--gd-button-dropShadow, 0 -2px 0 0) var(--gd-palette-complementary-9-t85)
292
+ inset;
293
+ }
294
+
295
+ &:active {
296
+ border-color: var(--gd-palette-complementary-9-t80);
297
+ background: var(--gd-palette-error-base-d20);
298
+ box-shadow: var(--gd-button-dropShadow, 0 2px 0 0) var(--gd-palette-complementary-9-t85)
299
+ inset;
300
+ }
301
+ }
302
+
303
+ &:disabled {
304
+ background-color: var(--gd-palette-error-disabled);
305
+ box-shadow: none;
306
+ border-color: transparent;
307
+ }
308
+ }
309
+ }
310
+ }
311
+
312
+ @keyframes rotate {
313
+ from {
314
+ transform: rotate(0deg);
315
+ }
316
+ to {
317
+ transform: rotate(360deg);
318
+ }
319
+ }