@salutejs/plasma-new-hope 0.186.0-canary.1542.11716355955.0 → 0.186.0-canary.1546.11723696357.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/components/Badge/Badge.css +4 -4
- package/cjs/components/Badge/Badge.js +16 -4
- package/cjs/components/Badge/Badge.js.map +1 -1
- package/cjs/components/Badge/Badge.tokens.js +10 -5
- package/cjs/components/Badge/Badge.tokens.js.map +1 -1
- package/cjs/components/Badge/variations/_clear/base.js +1 -1
- package/cjs/components/Badge/variations/_clear/base.js.map +1 -1
- package/cjs/components/Badge/variations/_clear/base_wiboj8.css +1 -0
- package/cjs/components/Badge/variations/_size/base.js +1 -1
- package/cjs/components/Badge/variations/_size/base.js.map +1 -1
- package/{es/components/Badge/variations/_size/base_to0y5x.css → cjs/components/Badge/variations/_size/base_rn38n6.css} +1 -1
- package/cjs/components/Badge/variations/_transparent/base.js +1 -1
- package/cjs/components/Badge/variations/_transparent/base.js.map +1 -1
- package/cjs/components/Badge/variations/_transparent/base_aapqhz.css +1 -0
- package/cjs/components/Badge/variations/_view/base.js +1 -1
- package/cjs/components/Badge/variations/_view/base.js.map +1 -1
- package/cjs/components/Badge/variations/_view/base_j3xzf3.css +1 -0
- package/cjs/index.css +4 -4
- package/cjs/index.js +0 -2
- package/cjs/index.js.map +1 -1
- package/emotion/cjs/components/Badge/Badge.js +21 -4
- package/emotion/cjs/components/Badge/Badge.tokens.js +10 -6
- package/emotion/cjs/components/Badge/variations/_clear/base.js +1 -1
- package/emotion/cjs/components/Badge/variations/_size/base.js +2 -1
- package/emotion/cjs/components/Badge/variations/_transparent/base.js +1 -1
- package/emotion/cjs/components/Badge/variations/_view/base.js +1 -1
- package/emotion/cjs/components/Combobox/ComboboxNew/index.js +1 -8
- package/emotion/cjs/components/Combobox/index.js +0 -6
- package/emotion/cjs/examples/plasma_b2c/components/Badge/Badge.config.js +14 -14
- package/emotion/cjs/examples/plasma_b2c/components/Badge/Badge.stories.tsx +8 -2
- package/emotion/cjs/examples/plasma_b2c/components/Combobox/Combobox.js +2 -7
- package/emotion/cjs/examples/plasma_b2c/components/Combobox/Combobox.stories.tsx +4 -62
- package/emotion/cjs/examples/plasma_web/components/Badge/Badge.config.js +14 -14
- package/emotion/cjs/examples/plasma_web/components/Badge/Badge.stories.tsx +8 -2
- package/emotion/es/components/Badge/Badge.js +23 -5
- package/emotion/es/components/Badge/Badge.tokens.js +9 -5
- package/emotion/es/components/Badge/variations/_clear/base.js +2 -2
- package/emotion/es/components/Badge/variations/_size/base.js +3 -2
- package/emotion/es/components/Badge/variations/_transparent/base.js +2 -2
- package/emotion/es/components/Badge/variations/_view/base.js +2 -2
- package/emotion/es/components/Combobox/ComboboxNew/index.js +1 -2
- package/emotion/es/components/Combobox/index.js +1 -1
- package/emotion/es/examples/plasma_b2c/components/Badge/Badge.config.js +14 -14
- package/emotion/es/examples/plasma_b2c/components/Badge/Badge.stories.tsx +8 -2
- package/emotion/es/examples/plasma_b2c/components/Combobox/Combobox.js +2 -7
- package/emotion/es/examples/plasma_b2c/components/Combobox/Combobox.stories.tsx +4 -62
- package/emotion/es/examples/plasma_web/components/Badge/Badge.config.js +14 -14
- package/emotion/es/examples/plasma_web/components/Badge/Badge.stories.tsx +8 -2
- package/es/components/Badge/Badge.css +4 -4
- package/es/components/Badge/Badge.js +19 -7
- package/es/components/Badge/Badge.js.map +1 -1
- package/es/components/Badge/Badge.tokens.js +10 -6
- package/es/components/Badge/Badge.tokens.js.map +1 -1
- package/es/components/Badge/variations/_clear/base.js +1 -1
- package/es/components/Badge/variations/_clear/base.js.map +1 -1
- package/es/components/Badge/variations/_clear/base_wiboj8.css +1 -0
- package/es/components/Badge/variations/_size/base.js +1 -1
- package/es/components/Badge/variations/_size/base.js.map +1 -1
- package/{cjs/components/Badge/variations/_size/base_to0y5x.css → es/components/Badge/variations/_size/base_rn38n6.css} +1 -1
- package/es/components/Badge/variations/_transparent/base.js +1 -1
- package/es/components/Badge/variations/_transparent/base.js.map +1 -1
- package/es/components/Badge/variations/_transparent/base_aapqhz.css +1 -0
- package/es/components/Badge/variations/_view/base.js +1 -1
- package/es/components/Badge/variations/_view/base.js.map +1 -1
- package/es/components/Badge/variations/_view/base_j3xzf3.css +1 -0
- package/es/index.css +4 -4
- package/es/index.js +0 -1
- package/es/index.js.map +1 -1
- package/package.json +2 -2
- package/styled-components/cjs/components/Badge/Badge.js +21 -4
- package/styled-components/cjs/components/Badge/Badge.tokens.js +10 -6
- package/styled-components/cjs/components/Badge/variations/_clear/base.js +1 -1
- package/styled-components/cjs/components/Badge/variations/_size/base.js +2 -1
- package/styled-components/cjs/components/Badge/variations/_transparent/base.js +1 -1
- package/styled-components/cjs/components/Badge/variations/_view/base.js +1 -1
- package/styled-components/cjs/components/Combobox/ComboboxNew/index.js +1 -8
- package/styled-components/cjs/components/Combobox/index.js +0 -6
- package/styled-components/cjs/examples/plasma_b2c/components/Badge/Badge.config.js +5 -5
- package/styled-components/cjs/examples/plasma_b2c/components/Badge/Badge.stories.tsx +8 -2
- package/styled-components/cjs/examples/plasma_b2c/components/Combobox/Combobox.js +2 -7
- package/styled-components/cjs/examples/plasma_b2c/components/Combobox/Combobox.stories.tsx +4 -62
- package/styled-components/cjs/examples/plasma_web/components/Badge/Badge.config.js +5 -5
- package/styled-components/cjs/examples/plasma_web/components/Badge/Badge.stories.tsx +8 -2
- package/styled-components/es/components/Badge/Badge.js +23 -5
- package/styled-components/es/components/Badge/Badge.tokens.js +9 -5
- package/styled-components/es/components/Badge/variations/_clear/base.js +2 -2
- package/styled-components/es/components/Badge/variations/_size/base.js +3 -2
- package/styled-components/es/components/Badge/variations/_transparent/base.js +2 -2
- package/styled-components/es/components/Badge/variations/_view/base.js +2 -2
- package/styled-components/es/components/Combobox/ComboboxNew/index.js +1 -2
- package/styled-components/es/components/Combobox/index.js +1 -1
- package/styled-components/es/examples/plasma_b2c/components/Badge/Badge.config.js +5 -5
- package/styled-components/es/examples/plasma_b2c/components/Badge/Badge.stories.tsx +8 -2
- package/styled-components/es/examples/plasma_b2c/components/Combobox/Combobox.js +2 -7
- package/styled-components/es/examples/plasma_b2c/components/Combobox/Combobox.stories.tsx +4 -62
- package/styled-components/es/examples/plasma_web/components/Badge/Badge.config.js +5 -5
- package/styled-components/es/examples/plasma_web/components/Badge/Badge.stories.tsx +8 -2
- package/types/components/Badge/Badge.d.ts.map +1 -1
- package/types/components/Badge/Badge.tokens.d.ts +8 -4
- package/types/components/Badge/Badge.tokens.d.ts.map +1 -1
- package/types/components/Badge/Badge.types.d.ts +18 -5
- package/types/components/Badge/Badge.types.d.ts.map +1 -1
- package/types/components/Badge/variations/_clear/base.d.ts.map +1 -1
- package/types/components/Badge/variations/_size/base.d.ts.map +1 -1
- package/types/components/Combobox/ComboboxNew/Combobox.types.d.ts +0 -21
- package/types/components/Combobox/ComboboxNew/Combobox.types.d.ts.map +1 -1
- package/types/components/Combobox/ComboboxNew/index.d.ts +0 -1
- package/types/components/Combobox/ComboboxNew/index.d.ts.map +1 -1
- package/types/components/Combobox/index.d.ts +1 -1
- package/types/components/Combobox/index.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Badge/Badge.config.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Badge/Badge.d.ts +58 -4
- package/types/examples/plasma_b2c/components/Badge/Badge.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Combobox/Combobox.d.ts +2 -3
- package/types/examples/plasma_b2c/components/Combobox/Combobox.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Badge/Badge.config.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Badge/Badge.d.ts +58 -4
- package/types/examples/plasma_web/components/Badge/Badge.d.ts.map +1 -1
- package/cjs/components/Badge/variations/_clear/base_oopyb7.css +0 -1
- package/cjs/components/Badge/variations/_transparent/base_1l6036y.css +0 -1
- package/cjs/components/Badge/variations/_view/base_qlxank.css +0 -1
- package/cjs/components/Combobox/ComboboxNew/Combobox.boundler.js +0 -22
- package/cjs/components/Combobox/ComboboxNew/Combobox.boundler.js.map +0 -1
- package/emotion/cjs/components/Combobox/ComboboxNew/Combobox.boundler.js +0 -21
- package/emotion/cjs/components/Combobox/ComboboxNew/utils/getForm.js +0 -90
- package/emotion/cjs/components/Combobox/ComboboxNew/utils/syntheticEvent.js +0 -53
- package/emotion/es/components/Combobox/ComboboxNew/Combobox.boundler.js +0 -14
- package/emotion/es/components/Combobox/ComboboxNew/utils/getForm.js +0 -83
- package/emotion/es/components/Combobox/ComboboxNew/utils/syntheticEvent.js +0 -47
- package/es/components/Badge/variations/_clear/base_oopyb7.css +0 -1
- package/es/components/Badge/variations/_transparent/base_1l6036y.css +0 -1
- package/es/components/Badge/variations/_view/base_qlxank.css +0 -1
- package/es/components/Combobox/ComboboxNew/Combobox.boundler.js +0 -18
- package/es/components/Combobox/ComboboxNew/Combobox.boundler.js.map +0 -1
- package/styled-components/cjs/components/Combobox/ComboboxNew/Combobox.boundler.js +0 -21
- package/styled-components/cjs/components/Combobox/ComboboxNew/utils/getForm.js +0 -90
- package/styled-components/cjs/components/Combobox/ComboboxNew/utils/syntheticEvent.js +0 -53
- package/styled-components/es/components/Combobox/ComboboxNew/Combobox.boundler.js +0 -14
- package/styled-components/es/components/Combobox/ComboboxNew/utils/getForm.js +0 -83
- package/styled-components/es/components/Combobox/ComboboxNew/utils/syntheticEvent.js +0 -47
- package/types/components/Combobox/ComboboxNew/Combobox.boundler.d.ts +0 -4
- package/types/components/Combobox/ComboboxNew/Combobox.boundler.d.ts.map +0 -1
- package/types/components/Combobox/ComboboxNew/utils/getForm.d.ts +0 -4
- package/types/components/Combobox/ComboboxNew/utils/getForm.d.ts.map +0 -1
- package/types/components/Combobox/ComboboxNew/utils/syntheticEvent.d.ts +0 -4
- package/types/components/Combobox/ComboboxNew/utils/syntheticEvent.d.ts.map +0 -1
@@ -3,15 +3,10 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.
|
6
|
+
exports.Combobox = void 0;
|
7
7
|
var _engines = /*#__PURE__*/require("../../../../engines");
|
8
8
|
var _ = /*#__PURE__*/require("../../../..");
|
9
|
-
var _getForm = /*#__PURE__*/require("../../../../components/Combobox/ComboboxNew/utils/getForm");
|
10
9
|
var _Combobox = /*#__PURE__*/require("./Combobox.config");
|
11
10
|
var mergedConfig = /*#__PURE__*/(0, _engines.mergeConfig)(_.comboboxNewConfig, _Combobox.config);
|
12
11
|
var ComboboxComponent = /*#__PURE__*/(0, _engines.component)(mergedConfig);
|
13
|
-
var Combobox = exports.Combobox = ComboboxComponent;
|
14
|
-
var ComboboxWithForm = exports.ComboboxWithForm = /*#__PURE__*/(0, _.boundCombobox)({
|
15
|
-
base: ComboboxComponent,
|
16
|
-
baseForm: /*#__PURE__*/(0, _getForm.getFormComponentGenerator)(ComboboxComponent)
|
17
|
-
});
|
12
|
+
var Combobox = exports.Combobox = ComboboxComponent;
|
@@ -1,12 +1,11 @@
|
|
1
|
-
import React, {
|
1
|
+
import React, { useState } from 'react';
|
2
2
|
import type { ComponentProps } from 'react';
|
3
3
|
import type { Meta, StoryObj } from '@storybook/react';
|
4
4
|
|
5
5
|
import { WithTheme } from '../../../_helpers';
|
6
6
|
import { IconDone } from '../../../../components/_Icon';
|
7
|
-
import { createEvent } from '../../../../components/Combobox/ComboboxNew/utils/syntheticEvent';
|
8
7
|
|
9
|
-
import { Combobox
|
8
|
+
import { Combobox } from './Combobox';
|
10
9
|
|
11
10
|
type StorySelectProps = ComponentProps<typeof Combobox> & {
|
12
11
|
enableContentLeft?: boolean;
|
@@ -357,7 +356,7 @@ const SingleStory = (args: StorySelectProps) => {
|
|
357
356
|
|
358
357
|
return (
|
359
358
|
<div style={{ width: '400px' }}>
|
360
|
-
<
|
359
|
+
<Combobox
|
361
360
|
{...args}
|
362
361
|
items={items}
|
363
362
|
value={value}
|
@@ -368,24 +367,6 @@ const SingleStory = (args: StorySelectProps) => {
|
|
368
367
|
);
|
369
368
|
};
|
370
369
|
|
371
|
-
const SingleFormStory = (args: StorySelectProps) => {
|
372
|
-
const handleChange = (event) => {
|
373
|
-
console.log(event);
|
374
|
-
};
|
375
|
-
|
376
|
-
return (
|
377
|
-
<div style={{ width: '400px' }}>
|
378
|
-
<ComboboxWithForm
|
379
|
-
{...args}
|
380
|
-
items={items}
|
381
|
-
formType
|
382
|
-
onChange={handleChange}
|
383
|
-
contentLeft={args.enableContentLeft ? <IconDone size="s" /> : undefined}
|
384
|
-
/>
|
385
|
-
</div>
|
386
|
-
);
|
387
|
-
};
|
388
|
-
|
389
370
|
export const Single: StoryObj<StorySelectProps> = {
|
390
371
|
render: (args) => <SingleStory {...args} />,
|
391
372
|
args: {
|
@@ -398,27 +379,14 @@ export const Single: StoryObj<StorySelectProps> = {
|
|
398
379
|
},
|
399
380
|
};
|
400
381
|
|
401
|
-
export const SingleForm: StoryObj<StorySelectProps> = {
|
402
|
-
render: (args) => <SingleFormStory {...args} />,
|
403
|
-
args: {
|
404
|
-
closeAfterSelect: true,
|
405
|
-
},
|
406
|
-
parameters: {
|
407
|
-
controls: {
|
408
|
-
exclude: ['isTargetAmount'],
|
409
|
-
},
|
410
|
-
},
|
411
|
-
};
|
412
|
-
|
413
382
|
const MultipleStory = (args: StorySelectProps) => {
|
414
383
|
const [value, setValue] = useState([]);
|
415
384
|
|
416
385
|
return (
|
417
386
|
<div style={{ width: '400px' }}>
|
418
|
-
<
|
387
|
+
<Combobox
|
419
388
|
{...args}
|
420
389
|
multiple
|
421
|
-
formType={false}
|
422
390
|
items={items}
|
423
391
|
value={value}
|
424
392
|
onChange={setValue}
|
@@ -428,35 +396,9 @@ const MultipleStory = (args: StorySelectProps) => {
|
|
428
396
|
);
|
429
397
|
};
|
430
398
|
|
431
|
-
const MultipleStoryForm = (args: StorySelectProps) => {
|
432
|
-
const handleChange = (event) => {
|
433
|
-
console.log(event);
|
434
|
-
};
|
435
|
-
|
436
|
-
return (
|
437
|
-
<div style={{ width: '400px' }}>
|
438
|
-
<ComboboxWithForm
|
439
|
-
{...args}
|
440
|
-
multiple
|
441
|
-
formType
|
442
|
-
onChange={handleChange}
|
443
|
-
items={items}
|
444
|
-
contentLeft={args.enableContentLeft ? <IconDone size="s" /> : undefined}
|
445
|
-
/>
|
446
|
-
</div>
|
447
|
-
);
|
448
|
-
};
|
449
|
-
|
450
399
|
export const Multiple: StoryObj<StorySelectProps> = {
|
451
400
|
render: (args) => <MultipleStory {...args} />,
|
452
401
|
args: {
|
453
402
|
closeAfterSelect: false,
|
454
403
|
},
|
455
404
|
};
|
456
|
-
|
457
|
-
export const MultipleForm: StoryObj<StorySelectProps> = {
|
458
|
-
render: (args) => <MultipleStoryForm {...args} />,
|
459
|
-
args: {
|
460
|
-
closeAfterSelect: false,
|
461
|
-
},
|
462
|
-
};
|
@@ -22,10 +22,10 @@ var config = exports.config = {
|
|
22
22
|
light: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--on-light-text-primary);", ":var(--on-dark-surface-solid-default);", ":var(--on-dark-text-primary);", ":var(--on-dark-surface-transparent-card);", ":var(--on-dark-text-primary);"], _Badge.badgeTokens.color, _Badge.badgeTokens.background, _Badge.badgeTokens.colorTransparent, _Badge.badgeTokens.backgroundTransparent, _Badge.badgeTokens.colorClear)
|
23
23
|
},
|
24
24
|
size: {
|
25
|
-
l: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.5rem;", ":1.75rem;", ":0.6875rem;", ":0.
|
26
|
-
m: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.375rem;", ":1.5rem;", ":0.5625rem;", ":0.
|
27
|
-
s: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.375rem;", ":1.25rem;", ":0.4375rem;", ":0.
|
28
|
-
xs: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.25rem;", ":1rem;", ":0.25rem;", ":0.
|
25
|
+
l: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.5rem;", ":1.75rem;", ":0 0.6875rem;", ":0 0.375rem;", ":var(--plasma-typo-body-s-font-family);", ":var(--plasma-typo-body-s-font-size);", ":var(--plasma-typo-body-s-font-style);", ":var(--plasma-typo-body-s-font-weight);", ":var(--plasma-typo-body-s-letter-spacing);", ":var(--plasma-typo-body-s-line-height);", ":-0.0625rem;", ":0.25rem;", ":0.25rem;", ":-0.0625rem;"], _Badge.badgeTokens.borderRadius, _Badge.badgeTokens.height, _Badge.badgeTokens.padding, _Badge.badgeTokens.paddingIconOnly, _Badge.badgeTokens.fontFamily, _Badge.badgeTokens.fontSize, _Badge.badgeTokens.fontStyle, _Badge.badgeTokens.fontWeight, _Badge.badgeTokens.letterSpacing, _Badge.badgeTokens.lineHeight, _Badge.badgeTokens.leftContentMarginLeft, _Badge.badgeTokens.leftContentMarginRight, _Badge.badgeTokens.rightContentMarginLeft, _Badge.badgeTokens.rightContentMarginRight),
|
26
|
+
m: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.375rem;", ":1.5rem;", ":0 0.5625rem;", ":0 0.375rem;", ":var(--plasma-typo-body-xs-font-family);", ":var(--plasma-typo-body-xs-font-size);", ":var(--plasma-typo-body-xs-font-style);", ":var(--plasma-typo-body-xs-font-weight);", ":var(--plasma-typo-body-xs-letter-spacing);", ":var(--plasma-typo-body-xs-line-height);", ":-0.0625rem;", ":0.1875rem;", ":0.1875rem;", ":-0.0625rem;"], _Badge.badgeTokens.borderRadius, _Badge.badgeTokens.height, _Badge.badgeTokens.padding, _Badge.badgeTokens.paddingIconOnly, _Badge.badgeTokens.fontFamily, _Badge.badgeTokens.fontSize, _Badge.badgeTokens.fontStyle, _Badge.badgeTokens.fontWeight, _Badge.badgeTokens.letterSpacing, _Badge.badgeTokens.lineHeight, _Badge.badgeTokens.leftContentMarginLeft, _Badge.badgeTokens.leftContentMarginRight, _Badge.badgeTokens.rightContentMarginLeft, _Badge.badgeTokens.rightContentMarginRight),
|
27
|
+
s: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.375rem;", ":1.25rem;", ":0 0.4375rem;", ":0 0.25rem;", ":var(--plasma-typo-body-xxs-font-family);", ":var(--plasma-typo-body-xxs-font-size);", ":var(--plasma-typo-body-xxs-font-style);", ":var(--plasma-typo-body-xxs-font-weight);", ":var(--plasma-typo-body-xxs-letter-spacing);", ":var(--plasma-typo-body-xxs-line-height);", ":-0.0625rem;", ":0.125rem;", ":0.125rem;", ":-0.0625rem;"], _Badge.badgeTokens.borderRadius, _Badge.badgeTokens.height, _Badge.badgeTokens.padding, _Badge.badgeTokens.paddingIconOnly, _Badge.badgeTokens.fontFamily, _Badge.badgeTokens.fontSize, _Badge.badgeTokens.fontStyle, _Badge.badgeTokens.fontWeight, _Badge.badgeTokens.letterSpacing, _Badge.badgeTokens.lineHeight, _Badge.badgeTokens.leftContentMarginLeft, _Badge.badgeTokens.leftContentMarginRight, _Badge.badgeTokens.rightContentMarginLeft, _Badge.badgeTokens.rightContentMarginRight),
|
28
|
+
xs: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.25rem;", ":1rem;", ":0 0.25rem;", ":0 0.188rem;", ":var(--plasma-typo-body-xxs-font-family);", ":var(--plasma-typo-body-xxs-font-size);", ":var(--plasma-typo-body-xxs-font-style);", ":var(--plasma-typo-body-xxs-font-weight);", ":var(--plasma-typo-body-xxs-letter-spacing);", ":var(--plasma-typo-body-xxs-line-height);", ":-0.0625rem;", ":0.125rem;", ":0.125rem;", ":-0.0625rem;"], _Badge.badgeTokens.borderRadius, _Badge.badgeTokens.height, _Badge.badgeTokens.padding, _Badge.badgeTokens.paddingIconOnly, _Badge.badgeTokens.fontFamily, _Badge.badgeTokens.fontSize, _Badge.badgeTokens.fontStyle, _Badge.badgeTokens.fontWeight, _Badge.badgeTokens.letterSpacing, _Badge.badgeTokens.lineHeight, _Badge.badgeTokens.leftContentMarginLeft, _Badge.badgeTokens.leftContentMarginRight, _Badge.badgeTokens.rightContentMarginLeft, _Badge.badgeTokens.rightContentMarginRight)
|
29
29
|
},
|
30
30
|
pilled: {
|
31
31
|
"true": /*#__PURE__*/(0, _styledComponents.css)(["", ":1.25rem;"], _Badge.badgeTokens.pilledBorderRadius)
|
@@ -34,7 +34,7 @@ var config = exports.config = {
|
|
34
34
|
"true": /*#__PURE__*/(0, _styledComponents.css)([""])
|
35
35
|
},
|
36
36
|
clear: {
|
37
|
-
"true": /*#__PURE__*/(0, _styledComponents.css)([""])
|
37
|
+
"true": /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--surface-clear);"], _Badge.badgeTokens.backgroundClear)
|
38
38
|
}
|
39
39
|
}
|
40
40
|
};
|
@@ -31,6 +31,10 @@ const meta: Meta<typeof Badge> = {
|
|
31
31
|
control: { type: 'boolean' },
|
32
32
|
if: { arg: 'clear', truthy: false },
|
33
33
|
},
|
34
|
+
text: {
|
35
|
+
control: { type: 'text' },
|
36
|
+
if: { arg: 'enableText', truthy: true },
|
37
|
+
},
|
34
38
|
...disableProps(['contentLeft', 'contentRight']),
|
35
39
|
},
|
36
40
|
};
|
@@ -40,6 +44,7 @@ export default meta;
|
|
40
44
|
type StoryProps = ComponentProps<typeof Badge> & {
|
41
45
|
enableContentLeft: boolean;
|
42
46
|
enableContentRight: boolean;
|
47
|
+
enableText: boolean;
|
43
48
|
};
|
44
49
|
type Story = StoryObj<StoryProps>;
|
45
50
|
|
@@ -60,13 +65,14 @@ export const Default: Story = {
|
|
60
65
|
},
|
61
66
|
enableContentRight: {
|
62
67
|
control: { type: 'boolean' },
|
63
|
-
if: { arg: '
|
68
|
+
if: { arg: 'enableText', truthy: true },
|
64
69
|
},
|
65
70
|
},
|
66
71
|
args: {
|
67
|
-
text: 'Hello',
|
68
72
|
view: 'default',
|
69
73
|
size: 'm',
|
74
|
+
enableText: true,
|
75
|
+
text: 'Hello',
|
70
76
|
enableContentLeft: false,
|
71
77
|
enableContentRight: false,
|
72
78
|
clear: false,
|
@@ -1,5 +1,11 @@
|
|
1
|
-
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
2
|
+
var _excluded = ["children", "className", "style", "text", "contentLeft", "contentRight", "size", "view", "customColor", "customBackgroundColor", "pilled", "transparent", "clear"];
|
2
3
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
4
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
5
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
6
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
7
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
8
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
3
9
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
4
10
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
5
11
|
import React, { forwardRef } from 'react';
|
@@ -10,16 +16,20 @@ import { base as pilledCSS } from './variations/_pilled/base';
|
|
10
16
|
import { base as transparentCSS } from './variations/_transparent/base';
|
11
17
|
import { base as clearCSS } from './variations/_clear/base';
|
12
18
|
import { StyledContentLeft, StyledContentMain, StyledContentRight, base } from './Badge.styles';
|
13
|
-
import { classes } from './Badge.tokens';
|
19
|
+
import { classes, privateTokens } from './Badge.tokens';
|
14
20
|
export var badgeRoot = function badgeRoot(Root) {
|
15
21
|
return /*#__PURE__*/forwardRef(function (props, ref) {
|
22
|
+
var _StyledContentLeft, _StyledContentMain, _StyledContentMain2, _StyledContentRight;
|
16
23
|
var children = props.children,
|
17
24
|
className = props.className,
|
25
|
+
style = props.style,
|
18
26
|
text = props.text,
|
19
27
|
contentLeft = props.contentLeft,
|
20
28
|
contentRight = props.contentRight,
|
21
29
|
size = props.size,
|
22
30
|
view = props.view,
|
31
|
+
customColor = props.customColor,
|
32
|
+
customBackgroundColor = props.customBackgroundColor,
|
23
33
|
_props$pilled = props.pilled,
|
24
34
|
pilled = _props$pilled === void 0 ? false : _props$pilled,
|
25
35
|
_props$transparent = props.transparent,
|
@@ -31,15 +41,23 @@ export var badgeRoot = function badgeRoot(Root) {
|
|
31
41
|
var transparentClass = transparent ? classes.badgeTransparent : undefined;
|
32
42
|
var clearClass = clear ? classes.badgeClear : undefined;
|
33
43
|
var txt = !text && typeof children === 'string' ? children : text;
|
44
|
+
var iconOnlyClass = !txt && contentLeft ? classes.iconOnly : undefined;
|
45
|
+
var BadgeContent = function BadgeContent() {
|
46
|
+
if (contentLeft) {
|
47
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, _StyledContentLeft || (_StyledContentLeft = /*#__PURE__*/React.createElement(StyledContentLeft, null, contentLeft)), txt ? _StyledContentMain || (_StyledContentMain = /*#__PURE__*/React.createElement(StyledContentMain, null, txt)) : children);
|
48
|
+
}
|
49
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, txt ? _StyledContentMain2 || (_StyledContentMain2 = /*#__PURE__*/React.createElement(StyledContentMain, null, txt)) : children, contentRight && (_StyledContentRight || (_StyledContentRight = /*#__PURE__*/React.createElement(StyledContentRight, null, contentRight))));
|
50
|
+
};
|
34
51
|
return /*#__PURE__*/React.createElement(Root, _extends({
|
35
52
|
ref: ref,
|
36
|
-
className: cx(pilledClass, transparentClass, clearClass, className),
|
53
|
+
className: cx(pilledClass, transparentClass, clearClass, iconOnlyClass, className),
|
37
54
|
view: view,
|
38
55
|
size: size,
|
39
56
|
pilled: pilled,
|
40
57
|
transparent: transparent,
|
41
|
-
clear: clear
|
42
|
-
|
58
|
+
clear: clear,
|
59
|
+
style: _objectSpread(_objectSpread({}, style), {}, _defineProperty(_defineProperty({}, privateTokens.customBackground, customBackgroundColor), privateTokens.customColor, customColor))
|
60
|
+
}, rest), /*#__PURE__*/React.createElement(BadgeContent, null));
|
43
61
|
});
|
44
62
|
};
|
45
63
|
export var badgeConfig = {
|
@@ -1,7 +1,12 @@
|
|
1
1
|
export var classes = {
|
2
2
|
badgePilled: 'badge-pilled',
|
3
3
|
badgeTransparent: 'badge-transparent',
|
4
|
-
badgeClear: 'badge-clear'
|
4
|
+
badgeClear: 'badge-clear',
|
5
|
+
iconOnly: 'badge-icon-only'
|
6
|
+
};
|
7
|
+
export var privateTokens = {
|
8
|
+
customBackground: '--plasma-badge-custom-background',
|
9
|
+
customColor: '--plasma-badge-custom-color'
|
5
10
|
};
|
6
11
|
export var tokens = {
|
7
12
|
background: '--plasma-badge-background',
|
@@ -9,13 +14,12 @@ export var tokens = {
|
|
9
14
|
backgroundTransparent: '--plasma-badge-background-transparent',
|
10
15
|
colorTransparent: '--plasma-badge-color-transparent',
|
11
16
|
colorClear: '--plasma-badge-color-clear',
|
17
|
+
backgroundClear: '--plasma-badge-background-clear',
|
12
18
|
borderRadius: '--plasma-badge-border-radius',
|
13
19
|
pilledBorderRadius: '--plasma-badge-pilled-border-radius',
|
14
20
|
height: '--plasma-badge-height',
|
15
|
-
|
16
|
-
|
17
|
-
paddingBottom: '--plasma-badge-padding-bottom',
|
18
|
-
paddingLeft: '--plasma-badge-padding-left',
|
21
|
+
padding: '--plasma-badge-padding',
|
22
|
+
paddingIconOnly: '--plasma-badge-padding-icon-only',
|
19
23
|
fontFamily: '--plasma-badge-font-family',
|
20
24
|
fontSize: '--plasma-badge-font-size',
|
21
25
|
fontStyle: '--plasma-badge-font-style',
|
@@ -1,3 +1,3 @@
|
|
1
1
|
import { css } from 'styled-components';
|
2
|
-
import { classes, tokens } from '../../Badge.tokens';
|
3
|
-
export var base = /*#__PURE__*/css(["&.", "{color:var(", ");background-color:
|
2
|
+
import { classes, privateTokens, tokens } from '../../Badge.tokens';
|
3
|
+
export var base = /*#__PURE__*/css(["&.", "{color:var(", ",var(", "));background-color:var(", ",var(", "));}"], classes.badgeClear, privateTokens.customColor, tokens.colorClear, privateTokens.customBackground, tokens.backgroundClear);
|
@@ -1,3 +1,4 @@
|
|
1
1
|
import { css } from 'styled-components';
|
2
|
-
import { tokens } from '../../Badge.tokens';
|
3
|
-
|
2
|
+
import { classes, tokens } from '../../Badge.tokens';
|
3
|
+
import { StyledContentLeft } from '../../Badge.styles';
|
4
|
+
export var base = /*#__PURE__*/css(["font-family:var(", ");font-size:var(", ");font-style:var(", ");font-weight:var(", ");letter-spacing:var(", ");line-height:var(", ");border-radius:var(", ");height:var(", ");padding:var(", ");&.", "{padding:var(", ");", "{margin:0;}}"], tokens.fontFamily, tokens.fontSize, tokens.fontStyle, tokens.fontWeight, tokens.letterSpacing, tokens.lineHeight, tokens.borderRadius, tokens.height, tokens.padding, classes.iconOnly, tokens.paddingIconOnly, StyledContentLeft);
|
@@ -1,3 +1,3 @@
|
|
1
1
|
import { css } from 'styled-components';
|
2
|
-
import { classes, tokens } from '../../Badge.tokens';
|
3
|
-
export var base = /*#__PURE__*/css(["&.", "{color:var(", ");background-color:var(", ");}"], classes.badgeTransparent, tokens.colorTransparent, tokens.backgroundTransparent);
|
2
|
+
import { classes, privateTokens, tokens } from '../../Badge.tokens';
|
3
|
+
export var base = /*#__PURE__*/css(["&.", "{color:var(", ",var(", "));background-color:var(", ",var(", "));}"], classes.badgeTransparent, privateTokens.customColor, tokens.colorTransparent, privateTokens.customBackground, tokens.backgroundTransparent);
|
@@ -1,3 +1,3 @@
|
|
1
1
|
import { css } from 'styled-components';
|
2
|
-
import { tokens } from '../../Badge.tokens';
|
3
|
-
export var base = /*#__PURE__*/css(["color:var(", ");background-color:var(", ");"], tokens.color, tokens.background);
|
2
|
+
import { privateTokens, tokens } from '../../Badge.tokens';
|
3
|
+
export var base = /*#__PURE__*/css(["color:var(", ",var(", "));background-color:var(", ",var(", "));"], privateTokens.customColor, tokens.color, privateTokens.customBackground, tokens.background);
|
@@ -1,2 +1,2 @@
|
|
1
1
|
export { comboboxRoot as comboboxOldRoot, comboboxConfig as comboboxOldConfig, comboboxDividerRoot, comboboxDividerConfig, comboboxFooterRoot, comboboxFooterConfig, comboboxGroupRoot, comboboxGroupConfig, comboboxHeaderRoot, comboboxHeaderConfig, comboboxItemRoot, comboboxItemConfig, ComboboxTarget, comboboxClasses as comboboxOldClasses, comboboxTokens as comboboxOldTokens } from './ComboboxOld';
|
2
|
-
export { comboboxTokens as comboboxNewTokens, comboboxRoot as comboboxNewRoot, comboboxConfig as comboboxNewConfig
|
2
|
+
export { comboboxTokens as comboboxNewTokens, comboboxRoot as comboboxNewRoot, comboboxConfig as comboboxNewConfig } from './ComboboxNew';
|
@@ -16,10 +16,10 @@ export var config = {
|
|
16
16
|
light: /*#__PURE__*/css(["", ":var(--on-light-text-primary);", ":var(--on-dark-surface-solid-default);", ":var(--on-dark-text-primary);", ":var(--on-dark-surface-transparent-card);", ":var(--on-dark-text-primary);"], badgeTokens.color, badgeTokens.background, badgeTokens.colorTransparent, badgeTokens.backgroundTransparent, badgeTokens.colorClear)
|
17
17
|
},
|
18
18
|
size: {
|
19
|
-
l: /*#__PURE__*/css(["", ":0.5rem;", ":1.75rem;", ":0.6875rem;", ":0.
|
20
|
-
m: /*#__PURE__*/css(["", ":0.375rem;", ":1.5rem;", ":0.5625rem;", ":0.
|
21
|
-
s: /*#__PURE__*/css(["", ":0.375rem;", ":1.25rem;", ":0.4375rem;", ":0.
|
22
|
-
xs: /*#__PURE__*/css(["", ":0.25rem;", ":1rem;", ":0.25rem;", ":0.
|
19
|
+
l: /*#__PURE__*/css(["", ":0.5rem;", ":1.75rem;", ":0 0.6875rem;", ":0 0.375rem;", ":var(--plasma-typo-body-s-font-family);", ":var(--plasma-typo-body-s-font-size);", ":var(--plasma-typo-body-s-font-style);", ":var(--plasma-typo-body-s-font-weight);", ":var(--plasma-typo-body-s-letter-spacing);", ":var(--plasma-typo-body-s-line-height);", ":-0.0625rem;", ":0.25rem;", ":0.25rem;", ":-0.0625rem;"], badgeTokens.borderRadius, badgeTokens.height, badgeTokens.padding, badgeTokens.paddingIconOnly, badgeTokens.fontFamily, badgeTokens.fontSize, badgeTokens.fontStyle, badgeTokens.fontWeight, badgeTokens.letterSpacing, badgeTokens.lineHeight, badgeTokens.leftContentMarginLeft, badgeTokens.leftContentMarginRight, badgeTokens.rightContentMarginLeft, badgeTokens.rightContentMarginRight),
|
20
|
+
m: /*#__PURE__*/css(["", ":0.375rem;", ":1.5rem;", ":0 0.5625rem;", ":0 0.375rem;", ":var(--plasma-typo-body-xs-font-family);", ":var(--plasma-typo-body-xs-font-size);", ":var(--plasma-typo-body-xs-font-style);", ":var(--plasma-typo-body-xs-font-weight);", ":var(--plasma-typo-body-xs-letter-spacing);", ":var(--plasma-typo-body-xs-line-height);", ":-0.0625rem;", ":0.1875rem;", ":0.1875rem;", ":-0.0625rem;"], badgeTokens.borderRadius, badgeTokens.height, badgeTokens.padding, badgeTokens.paddingIconOnly, badgeTokens.fontFamily, badgeTokens.fontSize, badgeTokens.fontStyle, badgeTokens.fontWeight, badgeTokens.letterSpacing, badgeTokens.lineHeight, badgeTokens.leftContentMarginLeft, badgeTokens.leftContentMarginRight, badgeTokens.rightContentMarginLeft, badgeTokens.rightContentMarginRight),
|
21
|
+
s: /*#__PURE__*/css(["", ":0.375rem;", ":1.25rem;", ":0 0.4375rem;", ":0 0.25rem;", ":var(--plasma-typo-body-xxs-font-family);", ":var(--plasma-typo-body-xxs-font-size);", ":var(--plasma-typo-body-xxs-font-style);", ":var(--plasma-typo-body-xxs-font-weight);", ":var(--plasma-typo-body-xxs-letter-spacing);", ":var(--plasma-typo-body-xxs-line-height);", ":-0.0625rem;", ":0.125rem;", ":0.125rem;", ":-0.0625rem;"], badgeTokens.borderRadius, badgeTokens.height, badgeTokens.padding, badgeTokens.paddingIconOnly, badgeTokens.fontFamily, badgeTokens.fontSize, badgeTokens.fontStyle, badgeTokens.fontWeight, badgeTokens.letterSpacing, badgeTokens.lineHeight, badgeTokens.leftContentMarginLeft, badgeTokens.leftContentMarginRight, badgeTokens.rightContentMarginLeft, badgeTokens.rightContentMarginRight),
|
22
|
+
xs: /*#__PURE__*/css(["", ":0.25rem;", ":1rem;", ":0 0.25rem;", ":0 0.188rem;", ":var(--plasma-typo-body-xxs-font-family);", ":var(--plasma-typo-body-xxs-font-size);", ":var(--plasma-typo-body-xxs-font-style);", ":var(--plasma-typo-body-xxs-font-weight);", ":var(--plasma-typo-body-xxs-letter-spacing);", ":var(--plasma-typo-body-xxs-line-height);", ":-0.0625rem;", ":0.125rem;", ":0.125rem;", ":-0.0625rem;"], badgeTokens.borderRadius, badgeTokens.height, badgeTokens.padding, badgeTokens.paddingIconOnly, badgeTokens.fontFamily, badgeTokens.fontSize, badgeTokens.fontStyle, badgeTokens.fontWeight, badgeTokens.letterSpacing, badgeTokens.lineHeight, badgeTokens.leftContentMarginLeft, badgeTokens.leftContentMarginRight, badgeTokens.rightContentMarginLeft, badgeTokens.rightContentMarginRight)
|
23
23
|
},
|
24
24
|
pilled: {
|
25
25
|
"true": /*#__PURE__*/css(["", ":1.25rem;"], badgeTokens.pilledBorderRadius)
|
@@ -28,7 +28,7 @@ export var config = {
|
|
28
28
|
"true": /*#__PURE__*/css([""])
|
29
29
|
},
|
30
30
|
clear: {
|
31
|
-
"true": /*#__PURE__*/css([""])
|
31
|
+
"true": /*#__PURE__*/css(["", ":var(--surface-clear);"], badgeTokens.backgroundClear)
|
32
32
|
}
|
33
33
|
}
|
34
34
|
};
|
@@ -31,6 +31,10 @@ const meta: Meta<typeof Badge> = {
|
|
31
31
|
control: { type: 'boolean' },
|
32
32
|
if: { arg: 'clear', truthy: false },
|
33
33
|
},
|
34
|
+
text: {
|
35
|
+
control: { type: 'text' },
|
36
|
+
if: { arg: 'enableText', truthy: true },
|
37
|
+
},
|
34
38
|
...disableProps(['contentLeft', 'contentRight']),
|
35
39
|
},
|
36
40
|
};
|
@@ -40,6 +44,7 @@ export default meta;
|
|
40
44
|
type StoryProps = ComponentProps<typeof Badge> & {
|
41
45
|
enableContentLeft: boolean;
|
42
46
|
enableContentRight: boolean;
|
47
|
+
enableText: boolean;
|
43
48
|
};
|
44
49
|
type Story = StoryObj<StoryProps>;
|
45
50
|
|
@@ -60,13 +65,14 @@ export const Default: Story = {
|
|
60
65
|
},
|
61
66
|
enableContentRight: {
|
62
67
|
control: { type: 'boolean' },
|
63
|
-
if: { arg: '
|
68
|
+
if: { arg: 'enableText', truthy: true },
|
64
69
|
},
|
65
70
|
},
|
66
71
|
args: {
|
67
|
-
text: 'Hello',
|
68
72
|
view: 'default',
|
69
73
|
size: 'm',
|
74
|
+
enableText: true,
|
75
|
+
text: 'Hello',
|
70
76
|
enableContentLeft: false,
|
71
77
|
enableContentRight: false,
|
72
78
|
clear: false,
|
@@ -1,12 +1,7 @@
|
|
1
1
|
import { component, mergeConfig } from '../../../../engines';
|
2
|
-
import { comboboxNewConfig
|
3
|
-
import { getFormComponentGenerator } from '../../../../components/Combobox/ComboboxNew/utils/getForm';
|
2
|
+
import { comboboxNewConfig } from '../../../..';
|
4
3
|
import { config } from './Combobox.config';
|
5
4
|
var mergedConfig = /*#__PURE__*/mergeConfig(comboboxNewConfig, config);
|
6
5
|
var ComboboxComponent = /*#__PURE__*/component(mergedConfig);
|
7
6
|
var Combobox = ComboboxComponent;
|
8
|
-
|
9
|
-
base: ComboboxComponent,
|
10
|
-
baseForm: /*#__PURE__*/getFormComponentGenerator(ComboboxComponent)
|
11
|
-
});
|
12
|
-
export { Combobox, ComboboxWithForm };
|
7
|
+
export { Combobox };
|
@@ -1,12 +1,11 @@
|
|
1
|
-
import React, {
|
1
|
+
import React, { useState } from 'react';
|
2
2
|
import type { ComponentProps } from 'react';
|
3
3
|
import type { Meta, StoryObj } from '@storybook/react';
|
4
4
|
|
5
5
|
import { WithTheme } from '../../../_helpers';
|
6
6
|
import { IconDone } from '../../../../components/_Icon';
|
7
|
-
import { createEvent } from '../../../../components/Combobox/ComboboxNew/utils/syntheticEvent';
|
8
7
|
|
9
|
-
import { Combobox
|
8
|
+
import { Combobox } from './Combobox';
|
10
9
|
|
11
10
|
type StorySelectProps = ComponentProps<typeof Combobox> & {
|
12
11
|
enableContentLeft?: boolean;
|
@@ -357,7 +356,7 @@ const SingleStory = (args: StorySelectProps) => {
|
|
357
356
|
|
358
357
|
return (
|
359
358
|
<div style={{ width: '400px' }}>
|
360
|
-
<
|
359
|
+
<Combobox
|
361
360
|
{...args}
|
362
361
|
items={items}
|
363
362
|
value={value}
|
@@ -368,24 +367,6 @@ const SingleStory = (args: StorySelectProps) => {
|
|
368
367
|
);
|
369
368
|
};
|
370
369
|
|
371
|
-
const SingleFormStory = (args: StorySelectProps) => {
|
372
|
-
const handleChange = (event) => {
|
373
|
-
console.log(event);
|
374
|
-
};
|
375
|
-
|
376
|
-
return (
|
377
|
-
<div style={{ width: '400px' }}>
|
378
|
-
<ComboboxWithForm
|
379
|
-
{...args}
|
380
|
-
items={items}
|
381
|
-
formType
|
382
|
-
onChange={handleChange}
|
383
|
-
contentLeft={args.enableContentLeft ? <IconDone size="s" /> : undefined}
|
384
|
-
/>
|
385
|
-
</div>
|
386
|
-
);
|
387
|
-
};
|
388
|
-
|
389
370
|
export const Single: StoryObj<StorySelectProps> = {
|
390
371
|
render: (args) => <SingleStory {...args} />,
|
391
372
|
args: {
|
@@ -398,27 +379,14 @@ export const Single: StoryObj<StorySelectProps> = {
|
|
398
379
|
},
|
399
380
|
};
|
400
381
|
|
401
|
-
export const SingleForm: StoryObj<StorySelectProps> = {
|
402
|
-
render: (args) => <SingleFormStory {...args} />,
|
403
|
-
args: {
|
404
|
-
closeAfterSelect: true,
|
405
|
-
},
|
406
|
-
parameters: {
|
407
|
-
controls: {
|
408
|
-
exclude: ['isTargetAmount'],
|
409
|
-
},
|
410
|
-
},
|
411
|
-
};
|
412
|
-
|
413
382
|
const MultipleStory = (args: StorySelectProps) => {
|
414
383
|
const [value, setValue] = useState([]);
|
415
384
|
|
416
385
|
return (
|
417
386
|
<div style={{ width: '400px' }}>
|
418
|
-
<
|
387
|
+
<Combobox
|
419
388
|
{...args}
|
420
389
|
multiple
|
421
|
-
formType={false}
|
422
390
|
items={items}
|
423
391
|
value={value}
|
424
392
|
onChange={setValue}
|
@@ -428,35 +396,9 @@ const MultipleStory = (args: StorySelectProps) => {
|
|
428
396
|
);
|
429
397
|
};
|
430
398
|
|
431
|
-
const MultipleStoryForm = (args: StorySelectProps) => {
|
432
|
-
const handleChange = (event) => {
|
433
|
-
console.log(event);
|
434
|
-
};
|
435
|
-
|
436
|
-
return (
|
437
|
-
<div style={{ width: '400px' }}>
|
438
|
-
<ComboboxWithForm
|
439
|
-
{...args}
|
440
|
-
multiple
|
441
|
-
formType
|
442
|
-
onChange={handleChange}
|
443
|
-
items={items}
|
444
|
-
contentLeft={args.enableContentLeft ? <IconDone size="s" /> : undefined}
|
445
|
-
/>
|
446
|
-
</div>
|
447
|
-
);
|
448
|
-
};
|
449
|
-
|
450
399
|
export const Multiple: StoryObj<StorySelectProps> = {
|
451
400
|
render: (args) => <MultipleStory {...args} />,
|
452
401
|
args: {
|
453
402
|
closeAfterSelect: false,
|
454
403
|
},
|
455
404
|
};
|
456
|
-
|
457
|
-
export const MultipleForm: StoryObj<StorySelectProps> = {
|
458
|
-
render: (args) => <MultipleStoryForm {...args} />,
|
459
|
-
args: {
|
460
|
-
closeAfterSelect: false,
|
461
|
-
},
|
462
|
-
};
|
@@ -16,10 +16,10 @@ export var config = {
|
|
16
16
|
light: /*#__PURE__*/css(["", ":var(--on-light-text-primary);", ":var(--on-dark-surface-solid-default);", ":var(--on-dark-text-primary);", ":var(--on-dark-surface-transparent-card);", ":var(--on-dark-text-primary);"], badgeTokens.color, badgeTokens.background, badgeTokens.colorTransparent, badgeTokens.backgroundTransparent, badgeTokens.colorClear)
|
17
17
|
},
|
18
18
|
size: {
|
19
|
-
l: /*#__PURE__*/css(["", ":0.5rem;", ":1.75rem;", ":0.6875rem;", ":0.
|
20
|
-
m: /*#__PURE__*/css(["", ":0.375rem;", ":1.5rem;", ":0.5625rem;", ":0.
|
21
|
-
s: /*#__PURE__*/css(["", ":0.375rem;", ":1.25rem;", ":0.4375rem;", ":0.
|
22
|
-
xs: /*#__PURE__*/css(["", ":0.25rem;", ":1rem;", ":0.25rem;", ":0.
|
19
|
+
l: /*#__PURE__*/css(["", ":0.5rem;", ":1.75rem;", ":0 0.6875rem;", ":0 0.375rem;", ":var(--plasma-typo-body-s-font-family);", ":var(--plasma-typo-body-s-font-size);", ":var(--plasma-typo-body-s-font-style);", ":var(--plasma-typo-body-s-font-weight);", ":var(--plasma-typo-body-s-letter-spacing);", ":var(--plasma-typo-body-s-line-height);", ":-0.0625rem;", ":0.25rem;", ":0.25rem;", ":-0.0625rem;"], badgeTokens.borderRadius, badgeTokens.height, badgeTokens.padding, badgeTokens.paddingIconOnly, badgeTokens.fontFamily, badgeTokens.fontSize, badgeTokens.fontStyle, badgeTokens.fontWeight, badgeTokens.letterSpacing, badgeTokens.lineHeight, badgeTokens.leftContentMarginLeft, badgeTokens.leftContentMarginRight, badgeTokens.rightContentMarginLeft, badgeTokens.rightContentMarginRight),
|
20
|
+
m: /*#__PURE__*/css(["", ":0.375rem;", ":1.5rem;", ":0 0.5625rem;", ":0 0.375rem;", ":var(--plasma-typo-body-xs-font-family);", ":var(--plasma-typo-body-xs-font-size);", ":var(--plasma-typo-body-xs-font-style);", ":var(--plasma-typo-body-xs-font-weight);", ":var(--plasma-typo-body-xs-letter-spacing);", ":var(--plasma-typo-body-xs-line-height);", ":-0.0625rem;", ":0.1875rem;", ":0.1875rem;", ":-0.0625rem;"], badgeTokens.borderRadius, badgeTokens.height, badgeTokens.padding, badgeTokens.paddingIconOnly, badgeTokens.fontFamily, badgeTokens.fontSize, badgeTokens.fontStyle, badgeTokens.fontWeight, badgeTokens.letterSpacing, badgeTokens.lineHeight, badgeTokens.leftContentMarginLeft, badgeTokens.leftContentMarginRight, badgeTokens.rightContentMarginLeft, badgeTokens.rightContentMarginRight),
|
21
|
+
s: /*#__PURE__*/css(["", ":0.375rem;", ":1.25rem;", ":0 0.4375rem;", ":0 0.25rem;", ":var(--plasma-typo-body-xxs-font-family);", ":var(--plasma-typo-body-xxs-font-size);", ":var(--plasma-typo-body-xxs-font-style);", ":var(--plasma-typo-body-xxs-font-weight);", ":var(--plasma-typo-body-xxs-letter-spacing);", ":var(--plasma-typo-body-xxs-line-height);", ":-0.0625rem;", ":0.125rem;", ":0.125rem;", ":-0.0625rem;"], badgeTokens.borderRadius, badgeTokens.height, badgeTokens.padding, badgeTokens.paddingIconOnly, badgeTokens.fontFamily, badgeTokens.fontSize, badgeTokens.fontStyle, badgeTokens.fontWeight, badgeTokens.letterSpacing, badgeTokens.lineHeight, badgeTokens.leftContentMarginLeft, badgeTokens.leftContentMarginRight, badgeTokens.rightContentMarginLeft, badgeTokens.rightContentMarginRight),
|
22
|
+
xs: /*#__PURE__*/css(["", ":0.25rem;", ":1rem;", ":0 0.25rem;", ":0 0.188rem;", ":var(--plasma-typo-body-xxs-font-family);", ":var(--plasma-typo-body-xxs-font-size);", ":var(--plasma-typo-body-xxs-font-style);", ":var(--plasma-typo-body-xxs-font-weight);", ":var(--plasma-typo-body-xxs-letter-spacing);", ":var(--plasma-typo-body-xxs-line-height);", ":-0.0625rem;", ":0.125rem;", ":0.125rem;", ":-0.0625rem;"], badgeTokens.borderRadius, badgeTokens.height, badgeTokens.padding, badgeTokens.paddingIconOnly, badgeTokens.fontFamily, badgeTokens.fontSize, badgeTokens.fontStyle, badgeTokens.fontWeight, badgeTokens.letterSpacing, badgeTokens.lineHeight, badgeTokens.leftContentMarginLeft, badgeTokens.leftContentMarginRight, badgeTokens.rightContentMarginLeft, badgeTokens.rightContentMarginRight)
|
23
23
|
},
|
24
24
|
pilled: {
|
25
25
|
"true": /*#__PURE__*/css(["", ":1.25rem;"], badgeTokens.pilledBorderRadius)
|
@@ -28,7 +28,7 @@ export var config = {
|
|
28
28
|
"true": /*#__PURE__*/css([""])
|
29
29
|
},
|
30
30
|
clear: {
|
31
|
-
"true": /*#__PURE__*/css([""])
|
31
|
+
"true": /*#__PURE__*/css(["", ":var(--surface-clear);"], badgeTokens.backgroundClear)
|
32
32
|
}
|
33
33
|
}
|
34
34
|
};
|
@@ -31,6 +31,10 @@ const meta: Meta<typeof Badge> = {
|
|
31
31
|
control: { type: 'boolean' },
|
32
32
|
if: { arg: 'clear', truthy: false },
|
33
33
|
},
|
34
|
+
text: {
|
35
|
+
control: { type: 'text' },
|
36
|
+
if: { arg: 'enableText', truthy: true },
|
37
|
+
},
|
34
38
|
...disableProps(['contentLeft', 'contentRight']),
|
35
39
|
},
|
36
40
|
};
|
@@ -40,6 +44,7 @@ export default meta;
|
|
40
44
|
type StoryProps = ComponentProps<typeof Badge> & {
|
41
45
|
enableContentLeft: boolean;
|
42
46
|
enableContentRight: boolean;
|
47
|
+
enableText: boolean;
|
43
48
|
};
|
44
49
|
type Story = StoryObj<StoryProps>;
|
45
50
|
|
@@ -60,13 +65,14 @@ export const Default: Story = {
|
|
60
65
|
},
|
61
66
|
enableContentRight: {
|
62
67
|
control: { type: 'boolean' },
|
63
|
-
if: { arg: '
|
68
|
+
if: { arg: 'enableText', truthy: true },
|
64
69
|
},
|
65
70
|
},
|
66
71
|
args: {
|
67
|
-
text: 'Hello',
|
68
72
|
view: 'default',
|
69
73
|
size: 'm',
|
74
|
+
enableText: true,
|
75
|
+
text: 'Hello',
|
70
76
|
enableContentLeft: false,
|
71
77
|
enableContentRight: false,
|
72
78
|
clear: false,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../../src/components/Badge/Badge.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
1
|
+
{"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../../src/components/Badge/Badge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoC,MAAM,OAAO,CAAC;AAEzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAQ/C,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAIhE,eAAO,MAAM,SAAS,SAAU,UAAU,cAAc,EAAE,cAAc,CAAC,sFAiEnE,CAAC;AAEP,eAAO,MAAM,WAAW;;;mBAnEQ,UAAU,cAAc,EAAE,cAAc,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;CAgGxE,CAAC"}
|