@gitlab/ui 71.10.0 → 71.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ # [71.11.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v71.10.0...v71.11.0) (2023-12-14)
2
+
3
+
4
+ ### Features
5
+
6
+ * **DesignTokens:** add transparency values as design tokens ([c4f5232](https://gitlab.com/gitlab-org/gitlab-ui/commit/c4f523206e3c4cbc607bea6445c16e4069c835f0))
7
+ * **GlDuoChat:** promote "/" commands ([8d3239b](https://gitlab.com/gitlab-org/gitlab-ui/commit/8d3239b85b0dd68a79ee4e7e61162ddad15f5e72))
8
+
1
9
  # [71.10.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v71.9.1...v71.10.0) (2023-12-13)
2
10
 
3
11
 
@@ -24,7 +24,8 @@ const i18n = {
24
24
  CHAT_LEGAL_GENERATED_BY_AI: 'Responses generated by AI',
25
25
  CHAT_EMPTY_STATE_TITLE: 'Ask a question',
26
26
  CHAT_EMPTY_STATE_DESC: 'AI generated explanations will appear here.',
27
- CHAT_PROMPT_PLACEHOLDER: 'GitLab Duo Chat',
27
+ CHAT_PROMPT_PLACEHOLDER_DEFAULT: 'GitLab Duo Chat',
28
+ CHAT_PROMPT_PLACEHOLDER_WITH_COMMANDS: 'Type "/" for slash commands',
28
29
  CHAT_SUBMIT_LABEL: 'Send chat message.',
29
30
  CHAT_LEGAL_DISCLAIMER: "May provide inappropriate responses not representative of GitLab's views. Do not input personal data.",
30
31
  CHAT_DEFAULT_PREDEFINED_PROMPTS: ['How do I change my password in GitLab?', 'How do I fork a project?', 'How do I clone a repository?', 'How do I create a template?']
@@ -36,15 +37,15 @@ const slashCommands = [{
36
37
  }, {
37
38
  name: '/tests',
38
39
  shouldSubmit: false,
39
- description: 'Write tests for the code snippet.'
40
+ description: 'Write tests for the selected snippet.'
40
41
  }, {
41
42
  name: '/refactor',
42
43
  shouldSubmit: false,
43
- description: 'Refactor the code snippet.'
44
+ description: 'Refactor the selected snippet.'
44
45
  }, {
45
46
  name: '/explain',
46
47
  shouldSubmit: false,
47
- description: 'Explain the code snippet.'
48
+ description: 'Explain the selected snippet.'
48
49
  }];
49
50
  const isMessage = item => Boolean(item) && (item === null || item === void 0 ? void 0 : item.role);
50
51
  const itemsValidator = items => items.every(isMessage);
@@ -193,6 +194,9 @@ var script = {
193
194
  const startsWithSlash = caseInsensitivePrompt.startsWith('/');
194
195
  const startsWithSlashCommand = slashCommands.some(c => caseInsensitivePrompt.startsWith(c.name));
195
196
  return startsWithSlash && this.filteredSlashCommands.length && !startsWithSlashCommand;
197
+ },
198
+ inputPlaceholder() {
199
+ return this.withSlashCommands ? i18n.CHAT_PROMPT_PLACEHOLDER_WITH_COMMANDS : i18n.CHAT_PROMPT_PLACEHOLDER_DEFAULT;
196
200
  }
197
201
  },
198
202
  watch: {
@@ -317,7 +321,7 @@ var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=
317
321
  {
318
322
  'gl-h-full': !_vm.hasMessages,
319
323
  'gl-h-auto': _vm.hasMessages,
320
- } ],attrs:{"tag":"div","name":"message"}},[_vm._l((_vm.conversations),function(conversation,index){return _c('gl-duo-chat-conversation',{key:("conversation-" + index),attrs:{"messages":conversation,"show-delimiter":index > 0},on:{"track-feedback":_vm.onTrackFeedback}})}),_vm._v(" "),(!_vm.hasMessages && !_vm.isLoading)?[_c('div',{key:"empty-state",staticClass:"gl-display-flex gl-flex-grow-1 gl-mr-auto gl-ml-auto"},[_c('gl-empty-state',{staticClass:"gl-align-self-center",attrs:{"svg-path":_vm.$options.emptySvg,"svg-height":145,"title":_vm.$options.i18n.CHAT_EMPTY_STATE_TITLE,"description":_vm.$options.i18n.CHAT_EMPTY_STATE_DESC}})],1),_vm._v(" "),_c('gl-duo-chat-predefined-prompts',{key:"predefined-prompts",attrs:{"prompts":_vm.predefinedPrompts},on:{"click":_vm.sendPredefinedPrompt}})]:_vm._e()],2),_vm._v(" "),_c('transition',{attrs:{"name":"loader"}},[(_vm.isLoading)?_c('gl-duo-chat-loader',{staticClass:"gl-px-0!",attrs:{"tool-name":_vm.toolName}}):_vm._e()],1)],1)],2),_vm._v(" "),(_vm.isChatAvailable)?_c('footer',{staticClass:"gl-drawer-footer gl-drawer-footer-sticky gl-p-5 gl-border-t gl-bg-gray-10",class:{ 'gl-drawer-body-scrim-on-footer': !_vm.scrolledToBottom },attrs:{"data-testid":"chat-footer"}},[_c('gl-form',{attrs:{"data-testid":"chat-prompt-form"},on:{"submit":function($event){$event.stopPropagation();$event.preventDefault();return _vm.sendChatPrompt.apply(null, arguments)}}},[_c('gl-form-input-group',{scopedSlots:_vm._u([{key:"append",fn:function(){return [_c('gl-button',{staticClass:"gl-absolute! gl-bottom-2 gl-right-2 gl-rounded-base!",attrs:{"icon":"paper-airplane","category":"primary","variant":"confirm","type":"submit","aria-label":_vm.$options.i18n.CHAT_SUBMIT_LABEL,"disabled":_vm.isLoading}})]},proxy:true}],null,false,2232229068)},[_c('div',{staticClass:"duo-chat-input gl-flex-grow-1 gl-vertical-align-top gl-max-w-full gl-min-h-8 gl-inset-border-1-gray-400 gl-rounded-base gl-bg-white",attrs:{"data-value":_vm.prompt}},[(_vm.shouldShowSlashCommands)?_c('gl-card',{ref:"commands",staticClass:"slash-commands gl-absolute! gl-translate-y-n100 gl-list-style-none gl-pl-0 gl-w-full gl-shadow-md",attrs:{"body-class":"gl-p-2!"}},_vm._l((_vm.filteredSlashCommands),function(command,index){return _c('gl-dropdown-item',{key:command.name,class:{ 'active-command': index === _vm.activeCommandIndex },on:{"click":function($event){return _vm.selectSlashCommand(index)}},nativeOn:{"mouseenter":function($event){_vm.activeCommandIndex = index;}}},[_c('span',{staticClass:"gl-display-flex gl-justify-content-space-between"},[_c('span',{staticClass:"gl-display-block"},[_vm._v(_vm._s(command.name))]),_vm._v(" "),_c('small',{staticClass:"gl-text-gray-500 gl-font-style-italic gl-text-right gl-pl-3"},[_vm._v(_vm._s(command.description))])])])}),1):_vm._e(),_vm._v(" "),_c('gl-form-textarea',{ref:"prompt",staticClass:"gl-absolute gl-h-full! gl-py-4! gl-bg-transparent! gl-rounded-top-right-none gl-rounded-bottom-right-none gl-shadow-none!",class:{ 'gl-text-truncate': !_vm.prompt },attrs:{"data-testid":"chat-prompt-input","placeholder":_vm.$options.i18n.CHAT_PROMPT_PLACEHOLDER,"disabled":_vm.isLoading,"autofocus":""},nativeOn:{"keydown":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"enter",13,$event.key,"Enter")){ return null; }if($event.ctrlKey||$event.shiftKey||$event.altKey||$event.metaKey){ return null; }$event.preventDefault();},"keyup":function($event){return _vm.onInputKeyup.apply(null, arguments)}},model:{value:(_vm.prompt),callback:function ($$v) {_vm.prompt=$$v;},expression:"prompt"}})],1)]),_vm._v(" "),_c('gl-form-text',{staticClass:"gl-text-gray-400 gl-line-height-20 gl-mt-3",attrs:{"data-testid":"chat-legal-disclaimer"}},[_vm._v(_vm._s(_vm.$options.i18n.CHAT_LEGAL_DISCLAIMER))])],1)],1):_vm._e()]):_vm._e()};
324
+ } ],attrs:{"tag":"div","name":"message"}},[_vm._l((_vm.conversations),function(conversation,index){return _c('gl-duo-chat-conversation',{key:("conversation-" + index),attrs:{"messages":conversation,"show-delimiter":index > 0},on:{"track-feedback":_vm.onTrackFeedback}})}),_vm._v(" "),(!_vm.hasMessages && !_vm.isLoading)?[_c('div',{key:"empty-state",staticClass:"gl-display-flex gl-flex-grow-1 gl-mr-auto gl-ml-auto"},[_c('gl-empty-state',{staticClass:"gl-align-self-center",attrs:{"svg-path":_vm.$options.emptySvg,"svg-height":145,"title":_vm.$options.i18n.CHAT_EMPTY_STATE_TITLE,"description":_vm.$options.i18n.CHAT_EMPTY_STATE_DESC}})],1),_vm._v(" "),_c('gl-duo-chat-predefined-prompts',{key:"predefined-prompts",attrs:{"prompts":_vm.predefinedPrompts},on:{"click":_vm.sendPredefinedPrompt}})]:_vm._e()],2),_vm._v(" "),_c('transition',{attrs:{"name":"loader"}},[(_vm.isLoading)?_c('gl-duo-chat-loader',{staticClass:"gl-px-0!",attrs:{"tool-name":_vm.toolName}}):_vm._e()],1)],1)],2),_vm._v(" "),(_vm.isChatAvailable)?_c('footer',{staticClass:"gl-drawer-footer gl-drawer-footer-sticky gl-p-5 gl-border-t gl-bg-gray-10",class:{ 'gl-drawer-body-scrim-on-footer': !_vm.scrolledToBottom },attrs:{"data-testid":"chat-footer"}},[_c('gl-form',{attrs:{"data-testid":"chat-prompt-form"},on:{"submit":function($event){$event.stopPropagation();$event.preventDefault();return _vm.sendChatPrompt.apply(null, arguments)}}},[_c('gl-form-input-group',{scopedSlots:_vm._u([{key:"append",fn:function(){return [_c('gl-button',{staticClass:"gl-absolute! gl-bottom-2 gl-right-2 gl-rounded-base!",attrs:{"icon":"paper-airplane","category":"primary","variant":"confirm","type":"submit","aria-label":_vm.$options.i18n.CHAT_SUBMIT_LABEL,"disabled":_vm.isLoading}})]},proxy:true}],null,false,2232229068)},[_c('div',{staticClass:"duo-chat-input gl-flex-grow-1 gl-vertical-align-top gl-max-w-full gl-min-h-8 gl-inset-border-1-gray-400 gl-rounded-base gl-bg-white",attrs:{"data-value":_vm.prompt}},[(_vm.shouldShowSlashCommands)?_c('gl-card',{ref:"commands",staticClass:"slash-commands gl-absolute! gl-translate-y-n100 gl-list-style-none gl-pl-0 gl-w-full gl-shadow-md",attrs:{"body-class":"gl-p-2!"}},_vm._l((_vm.filteredSlashCommands),function(command,index){return _c('gl-dropdown-item',{key:command.name,class:{ 'active-command': index === _vm.activeCommandIndex },on:{"click":function($event){return _vm.selectSlashCommand(index)}},nativeOn:{"mouseenter":function($event){_vm.activeCommandIndex = index;}}},[_c('span',{staticClass:"gl-display-flex gl-justify-content-space-between"},[_c('span',{staticClass:"gl-display-block"},[_vm._v(_vm._s(command.name))]),_vm._v(" "),_c('small',{staticClass:"gl-text-gray-500 gl-font-style-italic gl-text-right gl-pl-3"},[_vm._v(_vm._s(command.description))])])])}),1):_vm._e(),_vm._v(" "),_c('gl-form-textarea',{ref:"prompt",staticClass:"gl-absolute gl-h-full! gl-py-4! gl-bg-transparent! gl-rounded-top-right-none gl-rounded-bottom-right-none gl-shadow-none!",class:{ 'gl-text-truncate': !_vm.prompt },attrs:{"data-testid":"chat-prompt-input","placeholder":_vm.inputPlaceholder,"disabled":_vm.isLoading,"autofocus":""},nativeOn:{"keydown":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"enter",13,$event.key,"Enter")){ return null; }if($event.ctrlKey||$event.shiftKey||$event.altKey||$event.metaKey){ return null; }$event.preventDefault();},"keyup":function($event){return _vm.onInputKeyup.apply(null, arguments)}},model:{value:(_vm.prompt),callback:function ($$v) {_vm.prompt=$$v;},expression:"prompt"}})],1)]),_vm._v(" "),_c('gl-form-text',{staticClass:"gl-text-gray-400 gl-line-height-20 gl-mt-3",attrs:{"data-testid":"chat-legal-disclaimer"}},[_vm._v(_vm._s(_vm.$options.i18n.CHAT_LEGAL_DISCLAIMER))])],1)],1):_vm._e()]):_vm._e()};
321
325
  var __vue_staticRenderFns__ = [];
322
326
 
323
327
  /* style */
@@ -5,6 +5,7 @@ const methods = {
5
5
  return [name, key].filter(Boolean).join('.');
6
6
  },
7
7
  getTextColorClass(value) {
8
+ if (value.startsWith('rgba(')) return '';
8
9
  const textColorVariant = colorFromBackground(value, 4.5);
9
10
  return {
10
11
  'gl-text-gray-950': textColorVariant === 'dark',
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Wed, 13 Dec 2023 16:29:09 GMT
3
+ * Generated on Thu, 14 Dec 2023 19:07:24 GMT
4
4
  */
5
5
 
6
6
  :root {
@@ -14,6 +14,19 @@
14
14
  --gl-line-height-20: 1.25rem;
15
15
  --gl-line-height-16: 1rem;
16
16
  --gl-line-height-12: 0.75rem;
17
+ --t-white-a-08: rgba(255, 255, 255, 0.08);
18
+ --t-white-a-06: rgba(255, 255, 255, 0.06);
19
+ --t-white-a-04: rgba(255, 255, 255, 0.04);
20
+ --t-white-a-02: rgba(255, 255, 255, 0.02);
21
+ --t-white-a-36: rgba(255, 255, 255, 0.36);
22
+ --t-white-a-24: rgba(255, 255, 255, 0.24);
23
+ --t-white-a-16: rgba(255, 255, 255, 0.16);
24
+ --t-gray-a-08: rgba(31, 30, 36, 0.08);
25
+ --t-gray-a-06: rgba(31, 30, 36, 0.06);
26
+ --t-gray-a-04: rgba(31, 30, 36, 0.04);
27
+ --t-gray-a-02: rgba(31, 30, 36, 0.02);
28
+ --t-gray-a-24: rgba(31, 30, 36, 0.24);
29
+ --t-gray-a-16: rgba(31, 30, 36, 0.16);
17
30
  --brand-gray-05: #2b2838;
18
31
  --brand-gray-04: #45424d;
19
32
  --brand-gray-03: #74717a;
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Wed, 13 Dec 2023 16:29:09 GMT
3
+ * Generated on Thu, 14 Dec 2023 19:07:24 GMT
4
4
  */
5
5
 
6
6
  :root.gl-dark {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Wed, 13 Dec 2023 16:29:09 GMT
3
+ * Generated on Thu, 14 Dec 2023 19:07:24 GMT
4
4
  */
5
5
 
6
6
  export const DATA_VIZ_GREEN_50 = "#133a03";
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Wed, 13 Dec 2023 16:29:09 GMT
3
+ * Generated on Thu, 14 Dec 2023 19:07:24 GMT
4
4
  */
5
5
 
6
6
  export const DATA_VIZ_GREEN_50 = "#ddfab7";
@@ -204,6 +204,19 @@ export const BRAND_GRAY_02 = "#a2a1a6";
204
204
  export const BRAND_GRAY_03 = "#74717a";
205
205
  export const BRAND_GRAY_04 = "#45424d";
206
206
  export const BRAND_GRAY_05 = "#2b2838";
207
+ export const T_GRAY_A_16 = "rgba(31, 30, 36, 0.16)";
208
+ export const T_GRAY_A_24 = "rgba(31, 30, 36, 0.24)";
209
+ export const T_GRAY_A_02 = "rgba(31, 30, 36, 0.02)";
210
+ export const T_GRAY_A_04 = "rgba(31, 30, 36, 0.04)";
211
+ export const T_GRAY_A_06 = "rgba(31, 30, 36, 0.06)";
212
+ export const T_GRAY_A_08 = "rgba(31, 30, 36, 0.08)";
213
+ export const T_WHITE_A_16 = "rgba(255, 255, 255, 0.16)";
214
+ export const T_WHITE_A_24 = "rgba(255, 255, 255, 0.24)";
215
+ export const T_WHITE_A_36 = "rgba(255, 255, 255, 0.36)";
216
+ export const T_WHITE_A_02 = "rgba(255, 255, 255, 0.02)";
217
+ export const T_WHITE_A_04 = "rgba(255, 255, 255, 0.04)";
218
+ export const T_WHITE_A_06 = "rgba(255, 255, 255, 0.06)";
219
+ export const T_WHITE_A_08 = "rgba(255, 255, 255, 0.08)";
207
220
  export const GL_LINE_HEIGHT_12 = "0.75rem";
208
221
  export const GL_LINE_HEIGHT_16 = "1rem";
209
222
  export const GL_LINE_HEIGHT_20 = "1.25rem";
@@ -200,7 +200,20 @@
200
200
  "brand-gray-02": "#a2a1a6",
201
201
  "brand-gray-03": "#74717a",
202
202
  "brand-gray-04": "#45424d",
203
- "brand-gray-05": "#2b2838"
203
+ "brand-gray-05": "#2b2838",
204
+ "t-gray-a-16": "rgba(31, 30, 36, 0.16)",
205
+ "t-gray-a-24": "rgba(31, 30, 36, 0.24)",
206
+ "t-gray-a-02": "rgba(31, 30, 36, 0.02)",
207
+ "t-gray-a-04": "rgba(31, 30, 36, 0.04)",
208
+ "t-gray-a-06": "rgba(31, 30, 36, 0.06)",
209
+ "t-gray-a-08": "rgba(31, 30, 36, 0.08)",
210
+ "t-white-a-16": "rgba(255, 255, 255, 0.16)",
211
+ "t-white-a-24": "rgba(255, 255, 255, 0.24)",
212
+ "t-white-a-36": "rgba(255, 255, 255, 0.36)",
213
+ "t-white-a-02": "rgba(255, 255, 255, 0.02)",
214
+ "t-white-a-04": "rgba(255, 255, 255, 0.04)",
215
+ "t-white-a-06": "rgba(255, 255, 255, 0.06)",
216
+ "t-white-a-08": "rgba(255, 255, 255, 0.08)"
204
217
  },
205
218
  "dimension": {
206
219
  "line-height-12": "0.75rem",
@@ -4194,6 +4194,270 @@
4194
4194
  }
4195
4195
  }
4196
4196
  },
4197
+ "t-gray-a": {
4198
+ "16": {
4199
+ "value": "rgba(31, 30, 36, 0.16)",
4200
+ "$type": "color",
4201
+ "themeable": true,
4202
+ "prefix": false,
4203
+ "filePath": "/builds/gitlab-org/gitlab-ui/src/tokens/color.transparency.tokens.json",
4204
+ "isSource": false,
4205
+ "original": {
4206
+ "value": "rgba(31, 30, 36, 0.16)",
4207
+ "$type": "color",
4208
+ "themeable": true,
4209
+ "prefix": false
4210
+ },
4211
+ "name": "RAY_A_16",
4212
+ "attributes": {},
4213
+ "path": [
4214
+ "t-gray-a",
4215
+ "16"
4216
+ ]
4217
+ },
4218
+ "24": {
4219
+ "value": "rgba(31, 30, 36, 0.24)",
4220
+ "$type": "color",
4221
+ "themeable": true,
4222
+ "prefix": false,
4223
+ "filePath": "/builds/gitlab-org/gitlab-ui/src/tokens/color.transparency.tokens.json",
4224
+ "isSource": false,
4225
+ "original": {
4226
+ "value": "rgba(31, 30, 36, 0.24)",
4227
+ "$type": "color",
4228
+ "themeable": true,
4229
+ "prefix": false
4230
+ },
4231
+ "name": "RAY_A_24",
4232
+ "attributes": {},
4233
+ "path": [
4234
+ "t-gray-a",
4235
+ "24"
4236
+ ]
4237
+ },
4238
+ "02": {
4239
+ "value": "rgba(31, 30, 36, 0.02)",
4240
+ "$type": "color",
4241
+ "themeable": true,
4242
+ "prefix": false,
4243
+ "filePath": "/builds/gitlab-org/gitlab-ui/src/tokens/color.transparency.tokens.json",
4244
+ "isSource": false,
4245
+ "original": {
4246
+ "value": "rgba(31, 30, 36, 0.02)",
4247
+ "$type": "color",
4248
+ "themeable": true,
4249
+ "prefix": false
4250
+ },
4251
+ "name": "RAY_A_02",
4252
+ "attributes": {},
4253
+ "path": [
4254
+ "t-gray-a",
4255
+ "02"
4256
+ ]
4257
+ },
4258
+ "04": {
4259
+ "value": "rgba(31, 30, 36, 0.04)",
4260
+ "$type": "color",
4261
+ "themeable": true,
4262
+ "prefix": false,
4263
+ "filePath": "/builds/gitlab-org/gitlab-ui/src/tokens/color.transparency.tokens.json",
4264
+ "isSource": false,
4265
+ "original": {
4266
+ "value": "rgba(31, 30, 36, 0.04)",
4267
+ "$type": "color",
4268
+ "themeable": true,
4269
+ "prefix": false
4270
+ },
4271
+ "name": "RAY_A_04",
4272
+ "attributes": {},
4273
+ "path": [
4274
+ "t-gray-a",
4275
+ "04"
4276
+ ]
4277
+ },
4278
+ "06": {
4279
+ "value": "rgba(31, 30, 36, 0.06)",
4280
+ "$type": "color",
4281
+ "themeable": true,
4282
+ "prefix": false,
4283
+ "filePath": "/builds/gitlab-org/gitlab-ui/src/tokens/color.transparency.tokens.json",
4284
+ "isSource": false,
4285
+ "original": {
4286
+ "value": "rgba(31, 30, 36, 0.06)",
4287
+ "$type": "color",
4288
+ "themeable": true,
4289
+ "prefix": false
4290
+ },
4291
+ "name": "RAY_A_06",
4292
+ "attributes": {},
4293
+ "path": [
4294
+ "t-gray-a",
4295
+ "06"
4296
+ ]
4297
+ },
4298
+ "08": {
4299
+ "value": "rgba(31, 30, 36, 0.08)",
4300
+ "$type": "color",
4301
+ "themeable": true,
4302
+ "prefix": false,
4303
+ "filePath": "/builds/gitlab-org/gitlab-ui/src/tokens/color.transparency.tokens.json",
4304
+ "isSource": false,
4305
+ "original": {
4306
+ "value": "rgba(31, 30, 36, 0.08)",
4307
+ "$type": "color",
4308
+ "themeable": true,
4309
+ "prefix": false
4310
+ },
4311
+ "name": "RAY_A_08",
4312
+ "attributes": {},
4313
+ "path": [
4314
+ "t-gray-a",
4315
+ "08"
4316
+ ]
4317
+ }
4318
+ },
4319
+ "t-white-a": {
4320
+ "16": {
4321
+ "value": "rgba(255, 255, 255, 0.16)",
4322
+ "$type": "color",
4323
+ "themeable": true,
4324
+ "prefix": false,
4325
+ "filePath": "/builds/gitlab-org/gitlab-ui/src/tokens/color.transparency.tokens.json",
4326
+ "isSource": false,
4327
+ "original": {
4328
+ "value": "rgba(255, 255, 255, 0.16)",
4329
+ "$type": "color",
4330
+ "themeable": true,
4331
+ "prefix": false
4332
+ },
4333
+ "name": "HITE_A_16",
4334
+ "attributes": {},
4335
+ "path": [
4336
+ "t-white-a",
4337
+ "16"
4338
+ ]
4339
+ },
4340
+ "24": {
4341
+ "value": "rgba(255, 255, 255, 0.24)",
4342
+ "$type": "color",
4343
+ "themeable": true,
4344
+ "prefix": false,
4345
+ "filePath": "/builds/gitlab-org/gitlab-ui/src/tokens/color.transparency.tokens.json",
4346
+ "isSource": false,
4347
+ "original": {
4348
+ "value": "rgba(255, 255, 255, 0.24)",
4349
+ "$type": "color",
4350
+ "themeable": true,
4351
+ "prefix": false
4352
+ },
4353
+ "name": "HITE_A_24",
4354
+ "attributes": {},
4355
+ "path": [
4356
+ "t-white-a",
4357
+ "24"
4358
+ ]
4359
+ },
4360
+ "36": {
4361
+ "value": "rgba(255, 255, 255, 0.36)",
4362
+ "$type": "color",
4363
+ "themeable": true,
4364
+ "prefix": false,
4365
+ "filePath": "/builds/gitlab-org/gitlab-ui/src/tokens/color.transparency.tokens.json",
4366
+ "isSource": false,
4367
+ "original": {
4368
+ "value": "rgba(255, 255, 255, 0.36)",
4369
+ "$type": "color",
4370
+ "themeable": true,
4371
+ "prefix": false
4372
+ },
4373
+ "name": "HITE_A_36",
4374
+ "attributes": {},
4375
+ "path": [
4376
+ "t-white-a",
4377
+ "36"
4378
+ ]
4379
+ },
4380
+ "02": {
4381
+ "value": "rgba(255, 255, 255, 0.02)",
4382
+ "$type": "color",
4383
+ "themeable": true,
4384
+ "prefix": false,
4385
+ "filePath": "/builds/gitlab-org/gitlab-ui/src/tokens/color.transparency.tokens.json",
4386
+ "isSource": false,
4387
+ "original": {
4388
+ "value": "rgba(255, 255, 255, 0.02)",
4389
+ "$type": "color",
4390
+ "themeable": true,
4391
+ "prefix": false
4392
+ },
4393
+ "name": "HITE_A_02",
4394
+ "attributes": {},
4395
+ "path": [
4396
+ "t-white-a",
4397
+ "02"
4398
+ ]
4399
+ },
4400
+ "04": {
4401
+ "value": "rgba(255, 255, 255, 0.04)",
4402
+ "$type": "color",
4403
+ "themeable": true,
4404
+ "prefix": false,
4405
+ "filePath": "/builds/gitlab-org/gitlab-ui/src/tokens/color.transparency.tokens.json",
4406
+ "isSource": false,
4407
+ "original": {
4408
+ "value": "rgba(255, 255, 255, 0.04)",
4409
+ "$type": "color",
4410
+ "themeable": true,
4411
+ "prefix": false
4412
+ },
4413
+ "name": "HITE_A_04",
4414
+ "attributes": {},
4415
+ "path": [
4416
+ "t-white-a",
4417
+ "04"
4418
+ ]
4419
+ },
4420
+ "06": {
4421
+ "value": "rgba(255, 255, 255, 0.06)",
4422
+ "$type": "color",
4423
+ "themeable": true,
4424
+ "prefix": false,
4425
+ "filePath": "/builds/gitlab-org/gitlab-ui/src/tokens/color.transparency.tokens.json",
4426
+ "isSource": false,
4427
+ "original": {
4428
+ "value": "rgba(255, 255, 255, 0.06)",
4429
+ "$type": "color",
4430
+ "themeable": true,
4431
+ "prefix": false
4432
+ },
4433
+ "name": "HITE_A_06",
4434
+ "attributes": {},
4435
+ "path": [
4436
+ "t-white-a",
4437
+ "06"
4438
+ ]
4439
+ },
4440
+ "08": {
4441
+ "value": "rgba(255, 255, 255, 0.08)",
4442
+ "$type": "color",
4443
+ "themeable": true,
4444
+ "prefix": false,
4445
+ "filePath": "/builds/gitlab-org/gitlab-ui/src/tokens/color.transparency.tokens.json",
4446
+ "isSource": false,
4447
+ "original": {
4448
+ "value": "rgba(255, 255, 255, 0.08)",
4449
+ "$type": "color",
4450
+ "themeable": true,
4451
+ "prefix": false
4452
+ },
4453
+ "name": "HITE_A_08",
4454
+ "attributes": {},
4455
+ "path": [
4456
+ "t-white-a",
4457
+ "08"
4458
+ ]
4459
+ }
4460
+ },
4197
4461
  "line-height": {
4198
4462
  "12": {
4199
4463
  "value": "0.75rem",
@@ -200,7 +200,20 @@
200
200
  "brand-gray-02": "#a2a1a6",
201
201
  "brand-gray-03": "#74717a",
202
202
  "brand-gray-04": "#45424d",
203
- "brand-gray-05": "#2b2838"
203
+ "brand-gray-05": "#2b2838",
204
+ "t-gray-a-16": "rgba(31, 30, 36, 0.16)",
205
+ "t-gray-a-24": "rgba(31, 30, 36, 0.24)",
206
+ "t-gray-a-02": "rgba(31, 30, 36, 0.02)",
207
+ "t-gray-a-04": "rgba(31, 30, 36, 0.04)",
208
+ "t-gray-a-06": "rgba(31, 30, 36, 0.06)",
209
+ "t-gray-a-08": "rgba(31, 30, 36, 0.08)",
210
+ "t-white-a-16": "rgba(255, 255, 255, 0.16)",
211
+ "t-white-a-24": "rgba(255, 255, 255, 0.24)",
212
+ "t-white-a-36": "rgba(255, 255, 255, 0.36)",
213
+ "t-white-a-02": "rgba(255, 255, 255, 0.02)",
214
+ "t-white-a-04": "rgba(255, 255, 255, 0.04)",
215
+ "t-white-a-06": "rgba(255, 255, 255, 0.06)",
216
+ "t-white-a-08": "rgba(255, 255, 255, 0.08)"
204
217
  },
205
218
  "dimension": {
206
219
  "line-height-12": "0.75rem",
@@ -4194,6 +4194,270 @@
4194
4194
  }
4195
4195
  }
4196
4196
  },
4197
+ "t-gray-a": {
4198
+ "16": {
4199
+ "value": "rgba(31, 30, 36, 0.16)",
4200
+ "$type": "color",
4201
+ "themeable": true,
4202
+ "prefix": false,
4203
+ "filePath": "/builds/gitlab-org/gitlab-ui/src/tokens/color.transparency.tokens.json",
4204
+ "isSource": false,
4205
+ "original": {
4206
+ "value": "rgba(31, 30, 36, 0.16)",
4207
+ "$type": "color",
4208
+ "themeable": true,
4209
+ "prefix": false
4210
+ },
4211
+ "name": "RAY_A_16",
4212
+ "attributes": {},
4213
+ "path": [
4214
+ "t-gray-a",
4215
+ "16"
4216
+ ]
4217
+ },
4218
+ "24": {
4219
+ "value": "rgba(31, 30, 36, 0.24)",
4220
+ "$type": "color",
4221
+ "themeable": true,
4222
+ "prefix": false,
4223
+ "filePath": "/builds/gitlab-org/gitlab-ui/src/tokens/color.transparency.tokens.json",
4224
+ "isSource": false,
4225
+ "original": {
4226
+ "value": "rgba(31, 30, 36, 0.24)",
4227
+ "$type": "color",
4228
+ "themeable": true,
4229
+ "prefix": false
4230
+ },
4231
+ "name": "RAY_A_24",
4232
+ "attributes": {},
4233
+ "path": [
4234
+ "t-gray-a",
4235
+ "24"
4236
+ ]
4237
+ },
4238
+ "02": {
4239
+ "value": "rgba(31, 30, 36, 0.02)",
4240
+ "$type": "color",
4241
+ "themeable": true,
4242
+ "prefix": false,
4243
+ "filePath": "/builds/gitlab-org/gitlab-ui/src/tokens/color.transparency.tokens.json",
4244
+ "isSource": false,
4245
+ "original": {
4246
+ "value": "rgba(31, 30, 36, 0.02)",
4247
+ "$type": "color",
4248
+ "themeable": true,
4249
+ "prefix": false
4250
+ },
4251
+ "name": "RAY_A_02",
4252
+ "attributes": {},
4253
+ "path": [
4254
+ "t-gray-a",
4255
+ "02"
4256
+ ]
4257
+ },
4258
+ "04": {
4259
+ "value": "rgba(31, 30, 36, 0.04)",
4260
+ "$type": "color",
4261
+ "themeable": true,
4262
+ "prefix": false,
4263
+ "filePath": "/builds/gitlab-org/gitlab-ui/src/tokens/color.transparency.tokens.json",
4264
+ "isSource": false,
4265
+ "original": {
4266
+ "value": "rgba(31, 30, 36, 0.04)",
4267
+ "$type": "color",
4268
+ "themeable": true,
4269
+ "prefix": false
4270
+ },
4271
+ "name": "RAY_A_04",
4272
+ "attributes": {},
4273
+ "path": [
4274
+ "t-gray-a",
4275
+ "04"
4276
+ ]
4277
+ },
4278
+ "06": {
4279
+ "value": "rgba(31, 30, 36, 0.06)",
4280
+ "$type": "color",
4281
+ "themeable": true,
4282
+ "prefix": false,
4283
+ "filePath": "/builds/gitlab-org/gitlab-ui/src/tokens/color.transparency.tokens.json",
4284
+ "isSource": false,
4285
+ "original": {
4286
+ "value": "rgba(31, 30, 36, 0.06)",
4287
+ "$type": "color",
4288
+ "themeable": true,
4289
+ "prefix": false
4290
+ },
4291
+ "name": "RAY_A_06",
4292
+ "attributes": {},
4293
+ "path": [
4294
+ "t-gray-a",
4295
+ "06"
4296
+ ]
4297
+ },
4298
+ "08": {
4299
+ "value": "rgba(31, 30, 36, 0.08)",
4300
+ "$type": "color",
4301
+ "themeable": true,
4302
+ "prefix": false,
4303
+ "filePath": "/builds/gitlab-org/gitlab-ui/src/tokens/color.transparency.tokens.json",
4304
+ "isSource": false,
4305
+ "original": {
4306
+ "value": "rgba(31, 30, 36, 0.08)",
4307
+ "$type": "color",
4308
+ "themeable": true,
4309
+ "prefix": false
4310
+ },
4311
+ "name": "RAY_A_08",
4312
+ "attributes": {},
4313
+ "path": [
4314
+ "t-gray-a",
4315
+ "08"
4316
+ ]
4317
+ }
4318
+ },
4319
+ "t-white-a": {
4320
+ "16": {
4321
+ "value": "rgba(255, 255, 255, 0.16)",
4322
+ "$type": "color",
4323
+ "themeable": true,
4324
+ "prefix": false,
4325
+ "filePath": "/builds/gitlab-org/gitlab-ui/src/tokens/color.transparency.tokens.json",
4326
+ "isSource": false,
4327
+ "original": {
4328
+ "value": "rgba(255, 255, 255, 0.16)",
4329
+ "$type": "color",
4330
+ "themeable": true,
4331
+ "prefix": false
4332
+ },
4333
+ "name": "HITE_A_16",
4334
+ "attributes": {},
4335
+ "path": [
4336
+ "t-white-a",
4337
+ "16"
4338
+ ]
4339
+ },
4340
+ "24": {
4341
+ "value": "rgba(255, 255, 255, 0.24)",
4342
+ "$type": "color",
4343
+ "themeable": true,
4344
+ "prefix": false,
4345
+ "filePath": "/builds/gitlab-org/gitlab-ui/src/tokens/color.transparency.tokens.json",
4346
+ "isSource": false,
4347
+ "original": {
4348
+ "value": "rgba(255, 255, 255, 0.24)",
4349
+ "$type": "color",
4350
+ "themeable": true,
4351
+ "prefix": false
4352
+ },
4353
+ "name": "HITE_A_24",
4354
+ "attributes": {},
4355
+ "path": [
4356
+ "t-white-a",
4357
+ "24"
4358
+ ]
4359
+ },
4360
+ "36": {
4361
+ "value": "rgba(255, 255, 255, 0.36)",
4362
+ "$type": "color",
4363
+ "themeable": true,
4364
+ "prefix": false,
4365
+ "filePath": "/builds/gitlab-org/gitlab-ui/src/tokens/color.transparency.tokens.json",
4366
+ "isSource": false,
4367
+ "original": {
4368
+ "value": "rgba(255, 255, 255, 0.36)",
4369
+ "$type": "color",
4370
+ "themeable": true,
4371
+ "prefix": false
4372
+ },
4373
+ "name": "HITE_A_36",
4374
+ "attributes": {},
4375
+ "path": [
4376
+ "t-white-a",
4377
+ "36"
4378
+ ]
4379
+ },
4380
+ "02": {
4381
+ "value": "rgba(255, 255, 255, 0.02)",
4382
+ "$type": "color",
4383
+ "themeable": true,
4384
+ "prefix": false,
4385
+ "filePath": "/builds/gitlab-org/gitlab-ui/src/tokens/color.transparency.tokens.json",
4386
+ "isSource": false,
4387
+ "original": {
4388
+ "value": "rgba(255, 255, 255, 0.02)",
4389
+ "$type": "color",
4390
+ "themeable": true,
4391
+ "prefix": false
4392
+ },
4393
+ "name": "HITE_A_02",
4394
+ "attributes": {},
4395
+ "path": [
4396
+ "t-white-a",
4397
+ "02"
4398
+ ]
4399
+ },
4400
+ "04": {
4401
+ "value": "rgba(255, 255, 255, 0.04)",
4402
+ "$type": "color",
4403
+ "themeable": true,
4404
+ "prefix": false,
4405
+ "filePath": "/builds/gitlab-org/gitlab-ui/src/tokens/color.transparency.tokens.json",
4406
+ "isSource": false,
4407
+ "original": {
4408
+ "value": "rgba(255, 255, 255, 0.04)",
4409
+ "$type": "color",
4410
+ "themeable": true,
4411
+ "prefix": false
4412
+ },
4413
+ "name": "HITE_A_04",
4414
+ "attributes": {},
4415
+ "path": [
4416
+ "t-white-a",
4417
+ "04"
4418
+ ]
4419
+ },
4420
+ "06": {
4421
+ "value": "rgba(255, 255, 255, 0.06)",
4422
+ "$type": "color",
4423
+ "themeable": true,
4424
+ "prefix": false,
4425
+ "filePath": "/builds/gitlab-org/gitlab-ui/src/tokens/color.transparency.tokens.json",
4426
+ "isSource": false,
4427
+ "original": {
4428
+ "value": "rgba(255, 255, 255, 0.06)",
4429
+ "$type": "color",
4430
+ "themeable": true,
4431
+ "prefix": false
4432
+ },
4433
+ "name": "HITE_A_06",
4434
+ "attributes": {},
4435
+ "path": [
4436
+ "t-white-a",
4437
+ "06"
4438
+ ]
4439
+ },
4440
+ "08": {
4441
+ "value": "rgba(255, 255, 255, 0.08)",
4442
+ "$type": "color",
4443
+ "themeable": true,
4444
+ "prefix": false,
4445
+ "filePath": "/builds/gitlab-org/gitlab-ui/src/tokens/color.transparency.tokens.json",
4446
+ "isSource": false,
4447
+ "original": {
4448
+ "value": "rgba(255, 255, 255, 0.08)",
4449
+ "$type": "color",
4450
+ "themeable": true,
4451
+ "prefix": false
4452
+ },
4453
+ "name": "HITE_A_08",
4454
+ "attributes": {},
4455
+ "path": [
4456
+ "t-white-a",
4457
+ "08"
4458
+ ]
4459
+ }
4460
+ },
4197
4461
  "line-height": {
4198
4462
  "12": {
4199
4463
  "value": "0.75rem",
@@ -1,6 +1,6 @@
1
1
 
2
2
  // Do not edit directly
3
- // Generated on Wed, 13 Dec 2023 16:29:09 GMT
3
+ // Generated on Thu, 14 Dec 2023 19:07:24 GMT
4
4
 
5
5
  $red-950: #fff4f3;
6
6
  $red-900: #fcf1ef;
@@ -1,6 +1,6 @@
1
1
 
2
2
  // Do not edit directly
3
- // Generated on Wed, 13 Dec 2023 16:29:09 GMT
3
+ // Generated on Thu, 14 Dec 2023 19:07:24 GMT
4
4
 
5
5
  $gl-line-height-52: 3.25rem;
6
6
  $gl-line-height-44: 2.75rem;
@@ -12,6 +12,19 @@ $gl-line-height-24: 1.5rem;
12
12
  $gl-line-height-20: 1.25rem;
13
13
  $gl-line-height-16: 1rem;
14
14
  $gl-line-height-12: 0.75rem;
15
+ $t-white-a-08: rgba(255, 255, 255, 0.08) !default;
16
+ $t-white-a-06: rgba(255, 255, 255, 0.06) !default;
17
+ $t-white-a-04: rgba(255, 255, 255, 0.04) !default;
18
+ $t-white-a-02: rgba(255, 255, 255, 0.02) !default;
19
+ $t-white-a-36: rgba(255, 255, 255, 0.36) !default;
20
+ $t-white-a-24: rgba(255, 255, 255, 0.24) !default;
21
+ $t-white-a-16: rgba(255, 255, 255, 0.16) !default;
22
+ $t-gray-a-08: rgba(31, 30, 36, 0.08) !default;
23
+ $t-gray-a-06: rgba(31, 30, 36, 0.06) !default;
24
+ $t-gray-a-04: rgba(31, 30, 36, 0.04) !default;
25
+ $t-gray-a-02: rgba(31, 30, 36, 0.02) !default;
26
+ $t-gray-a-24: rgba(31, 30, 36, 0.24) !default;
27
+ $t-gray-a-16: rgba(31, 30, 36, 0.16) !default;
15
28
  $brand-gray-05: #2b2838 !default;
16
29
  $brand-gray-04: #45424d !default;
17
30
  $brand-gray-03: #74717a !default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitlab/ui",
3
- "version": "71.10.0",
3
+ "version": "71.11.0",
4
4
  "description": "GitLab UI Components",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -444,6 +444,15 @@ describe('GlDuoChat', () => {
444
444
  await nextTick();
445
445
  expect(findSlashCommandsCard().exists()).toBe(false);
446
446
  });
447
+
448
+ it('shows default placeholder in the chat input', () => {
449
+ createComponent({
450
+ propsData: {
451
+ withSlashCommands: false,
452
+ },
453
+ });
454
+ expect(findChatInput().attributes('placeholder')).toBe('GitLab Duo Chat');
455
+ });
447
456
  });
448
457
 
449
458
  describe('with the `withSlashCommands` enabled', () => {
@@ -478,6 +487,15 @@ describe('GlDuoChat', () => {
478
487
  });
479
488
  });
480
489
 
490
+ it('shows the correct placeholder in the chat input', () => {
491
+ createComponent({
492
+ propsData: {
493
+ withSlashCommands: true,
494
+ },
495
+ });
496
+ expect(findChatInput().attributes('placeholder')).toBe('Type "/" for slash commands');
497
+ });
498
+
481
499
  describe('when the prompt includes the "/" character or no characters', () => {
482
500
  it.each(['', '//', '\\', 'foo', '/foo'])(
483
501
  'does not render the slash commands if prompt is "$prompt"',
@@ -24,7 +24,8 @@ export const i18n = {
24
24
  CHAT_LEGAL_GENERATED_BY_AI: 'Responses generated by AI',
25
25
  CHAT_EMPTY_STATE_TITLE: 'Ask a question',
26
26
  CHAT_EMPTY_STATE_DESC: 'AI generated explanations will appear here.',
27
- CHAT_PROMPT_PLACEHOLDER: 'GitLab Duo Chat',
27
+ CHAT_PROMPT_PLACEHOLDER_DEFAULT: 'GitLab Duo Chat',
28
+ CHAT_PROMPT_PLACEHOLDER_WITH_COMMANDS: 'Type "/" for slash commands',
28
29
  CHAT_SUBMIT_LABEL: 'Send chat message.',
29
30
  CHAT_LEGAL_DISCLAIMER:
30
31
  "May provide inappropriate responses not representative of GitLab's views. Do not input personal data.",
@@ -45,17 +46,17 @@ export const slashCommands = [
45
46
  {
46
47
  name: '/tests',
47
48
  shouldSubmit: false,
48
- description: 'Write tests for the code snippet.',
49
+ description: 'Write tests for the selected snippet.',
49
50
  },
50
51
  {
51
52
  name: '/refactor',
52
53
  shouldSubmit: false,
53
- description: 'Refactor the code snippet.',
54
+ description: 'Refactor the selected snippet.',
54
55
  },
55
56
  {
56
57
  name: '/explain',
57
58
  shouldSubmit: false,
58
- description: 'Explain the code snippet.',
59
+ description: 'Explain the selected snippet.',
59
60
  },
60
61
  ];
61
62
 
@@ -215,6 +216,11 @@ export default {
215
216
  );
216
217
  return startsWithSlash && this.filteredSlashCommands.length && !startsWithSlashCommand;
217
218
  },
219
+ inputPlaceholder() {
220
+ return this.withSlashCommands
221
+ ? i18n.CHAT_PROMPT_PLACEHOLDER_WITH_COMMANDS
222
+ : i18n.CHAT_PROMPT_PLACEHOLDER_DEFAULT;
223
+ },
218
224
  },
219
225
  watch: {
220
226
  isLoading() {
@@ -471,7 +477,7 @@ export default {
471
477
  data-testid="chat-prompt-input"
472
478
  class="gl-absolute gl-h-full! gl-py-4! gl-bg-transparent! gl-rounded-top-right-none gl-rounded-bottom-right-none gl-shadow-none!"
473
479
  :class="{ 'gl-text-truncate': !prompt }"
474
- :placeholder="$options.i18n.CHAT_PROMPT_PLACEHOLDER"
480
+ :placeholder="inputPlaceholder"
475
481
  :disabled="isLoading"
476
482
  autofocus
477
483
  @keydown.enter.exact.native.prevent
@@ -58,13 +58,6 @@ $white-dark: #eaeaea !default;
58
58
  $white-transparent: rgba(255, 255, 255, 0.8) !default;
59
59
  $transparent-rgba: rgba($white, 0);
60
60
 
61
- $t-gray-a-02: rgba($gray-950, 0.02) !default;
62
- $t-gray-a-04: rgba($gray-950, 0.04) !default;
63
- $t-gray-a-06: rgba($gray-950, 0.06) !default;
64
- $t-gray-a-08: rgba($gray-950, 0.08) !default;
65
- $t-gray-a-16: rgba($gray-950, 0.16) !default;
66
- $t-gray-a-24: rgba($gray-950, 0.24) !default;
67
-
68
61
  // Text
69
62
  $gl-text-color: $gray-900 !default;
70
63
  $gl-text-color-secondary: $gray-500 !default;
@@ -0,0 +1,84 @@
1
+ {
2
+ "t-gray-a": {
3
+ "02": {
4
+ "$value": "rgba(31, 30, 36, 0.02)",
5
+ "$type": "color",
6
+ "themeable": true,
7
+ "prefix": false
8
+ },
9
+ "04": {
10
+ "$value": "rgba(31, 30, 36, 0.04)",
11
+ "$type": "color",
12
+ "themeable": true,
13
+ "prefix": false
14
+ },
15
+ "06": {
16
+ "$value": "rgba(31, 30, 36, 0.06)",
17
+ "$type": "color",
18
+ "themeable": true,
19
+ "prefix": false
20
+ },
21
+ "08": {
22
+ "$value": "rgba(31, 30, 36, 0.08)",
23
+ "$type": "color",
24
+ "themeable": true,
25
+ "prefix": false
26
+ },
27
+ "16": {
28
+ "$value": "rgba(31, 30, 36, 0.16)",
29
+ "$type": "color",
30
+ "themeable": true,
31
+ "prefix": false
32
+ },
33
+ "24": {
34
+ "$value": "rgba(31, 30, 36, 0.24)",
35
+ "$type": "color",
36
+ "themeable": true,
37
+ "prefix": false
38
+ }
39
+ },
40
+ "t-white-a": {
41
+ "02": {
42
+ "$value": "rgba(255, 255, 255, 0.02)",
43
+ "$type": "color",
44
+ "themeable": true,
45
+ "prefix": false
46
+ },
47
+ "04": {
48
+ "$value": "rgba(255, 255, 255, 0.04)",
49
+ "$type": "color",
50
+ "themeable": true,
51
+ "prefix": false
52
+ },
53
+ "06": {
54
+ "$value": "rgba(255, 255, 255, 0.06)",
55
+ "$type": "color",
56
+ "themeable": true,
57
+ "prefix": false
58
+ },
59
+ "08": {
60
+ "$value": "rgba(255, 255, 255, 0.08)",
61
+ "$type": "color",
62
+ "themeable": true,
63
+ "prefix": false
64
+ },
65
+ "16": {
66
+ "$value": "rgba(255, 255, 255, 0.16)",
67
+ "$type": "color",
68
+ "themeable": true,
69
+ "prefix": false
70
+ },
71
+ "24": {
72
+ "$value": "rgba(255, 255, 255, 0.24)",
73
+ "$type": "color",
74
+ "themeable": true,
75
+ "prefix": false
76
+ },
77
+ "36": {
78
+ "$value": "rgba(255, 255, 255, 0.36)",
79
+ "$type": "color",
80
+ "themeable": true,
81
+ "prefix": false
82
+ }
83
+ }
84
+ }
@@ -0,0 +1,26 @@
1
+ import { methods, template } from './common_story_options';
2
+ import colorTokens from './color.transparency.tokens.json';
3
+
4
+ const generateProps = ({ name = '', tokens = colorTokens } = {}) => ({
5
+ name,
6
+ tokens,
7
+ });
8
+
9
+ export const Gray = (args, { argTypes }) => ({
10
+ props: Object.keys(argTypes),
11
+ methods,
12
+ template,
13
+ });
14
+ Gray.args = generateProps({ name: 't-gray-a', tokens: colorTokens['t-gray-a'] });
15
+
16
+ export const White = (args, { argTypes }) => ({
17
+ props: Object.keys(argTypes),
18
+ methods,
19
+ template: `<div class="gl-bg-gray-900 gl-text-white">${template}</div>`,
20
+ });
21
+ White.args = generateProps({ name: 't-white-a', tokens: colorTokens['t-white-a'] });
22
+
23
+ // eslint-disable-next-line storybook/csf-component
24
+ export default {
25
+ title: 'tokens/color/transparency',
26
+ };
@@ -5,6 +5,7 @@ export const methods = {
5
5
  return [name, key].filter(Boolean).join('.');
6
6
  },
7
7
  getTextColorClass(value) {
8
+ if (value.startsWith('rgba(')) return '';
8
9
  const textColorVariant = colorFromBackground(value, 4.5);
9
10
  return {
10
11
  'gl-text-gray-950': textColorVariant === 'dark',