@channel.io/bezier-react 3.1.2 → 3.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/SegmentedControl/SegmentedControl.js +10 -3
- package/dist/cjs/components/SegmentedControl/SegmentedControl.js.map +1 -1
- package/dist/cjs/styles.css +1 -1
- package/dist/esm/components/SegmentedControl/SegmentedControl.mjs +10 -3
- package/dist/esm/components/SegmentedControl/SegmentedControl.mjs.map +1 -1
- package/dist/esm/styles.css +1 -1
- package/dist/types/components/SegmentedControl/SegmentedControl.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/SegmentedControl/SegmentedControl.module.scss +1 -1
- package/src/components/SegmentedControl/SegmentedControl.tsx +16 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SegmentedControl.d.ts","sourceRoot":"","sources":["../../../../src/components/SegmentedControl/SegmentedControl.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,GAAG,EAKT,MAAM,OAAO,CAAA;AACd,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAkB9B,OAAO,EAEL,KAAK,yBAAyB,EAC9B,KAAK,qBAAqB,
|
|
1
|
+
{"version":3,"file":"SegmentedControl.d.ts","sourceRoot":"","sources":["../../../../src/components/SegmentedControl/SegmentedControl.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,GAAG,EAKT,MAAM,OAAO,CAAA;AACd,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAkB9B,OAAO,EAEL,KAAK,yBAAyB,EAC9B,KAAK,qBAAqB,EAG1B,KAAK,+BAA+B,EACpC,KAAK,4BAA4B,EAEjC,KAAK,oBAAoB,EAC1B,MAAM,0BAA0B,CAAA;AA6IjC;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,EAA+B,CACjE,KAAK,EAAE,4BAA4B,GAAG;IACpC,GAAG,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC,cAAc,CAAC,CAAA;CACzC,KACE,GAAG,CAAC,OAAO,CAAA;AAEhB;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B,EAA4B,CACjE,KAAK,SAAS,MAAM,EAEpB,KAAK,EAAE,+BAA+B,CAAC,KAAK,CAAC,GAAG;IAC9C,GAAG,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC,cAAc,CAAC,CAAA;CACzC,KACE,GAAG,CAAC,OAAO,CAAA;AA+ChB;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,gBAAgB,EAAuC,CAClE,IAAI,SAAS,oBAAoB,EACjC,KAAK,SAAS,MAAM,EAEpB,KAAK,EAAE,qBAAqB,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG;IAC1C,GAAG,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC,cAAc,CAAC,CAAA;CACzC,KACE,GAAG,CAAC,OAAO,CAAA;AAgGhB;;;;;;;;GAQG;AACH,eAAO,MAAM,oBAAoB,EAA2C,CAC1E,KAAK,SAAS,MAAM,EAEpB,KAAK,EAAE,yBAAyB,CAAC,KAAK,CAAC,GAAG;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC,iBAAiB,CAAC,CAAA;CAC5C,KACE,GAAG,CAAC,OAAO,CAAA"}
|
package/package.json
CHANGED
|
@@ -31,6 +31,7 @@ import {
|
|
|
31
31
|
type SegmentedControlItemProps,
|
|
32
32
|
type SegmentedControlProps,
|
|
33
33
|
type SegmentedControlRadioGroupProps,
|
|
34
|
+
type SegmentedControlSize,
|
|
34
35
|
type SegmentedControlTabContentProps,
|
|
35
36
|
type SegmentedControlTabListProps,
|
|
36
37
|
type SegmentedControlTabsProps,
|
|
@@ -289,6 +290,17 @@ type ItemProps<Type extends SegmentedControlType> = (Type extends 'radiogroup'
|
|
|
289
290
|
React.HTMLAttributes<HTMLButtonElement> &
|
|
290
291
|
Partial<SegmentedControlItemProps<Type>>
|
|
291
292
|
|
|
293
|
+
function getTypography(size: SegmentedControlSize) {
|
|
294
|
+
return (
|
|
295
|
+
{
|
|
296
|
+
xs: '13',
|
|
297
|
+
s: '13',
|
|
298
|
+
m: '13',
|
|
299
|
+
l: '14',
|
|
300
|
+
} as const
|
|
301
|
+
)[size]
|
|
302
|
+
}
|
|
303
|
+
|
|
292
304
|
const Item = forwardRef<HTMLButtonElement, ItemProps<SegmentedControlType>>(
|
|
293
305
|
function Item(
|
|
294
306
|
{ children, leftContent, rightContent, className, ...rest },
|
|
@@ -324,17 +336,18 @@ const Item = forwardRef<HTMLButtonElement, ItemProps<SegmentedControlType>>(
|
|
|
324
336
|
<HStack
|
|
325
337
|
className={styles.SegmentedControlItemContainer}
|
|
326
338
|
align="center"
|
|
327
|
-
spacing={
|
|
339
|
+
spacing={4}
|
|
328
340
|
>
|
|
329
341
|
{leftContent}
|
|
342
|
+
|
|
330
343
|
<Text
|
|
331
344
|
className={styles.SegmentedControlItemLabel}
|
|
332
345
|
bold
|
|
333
|
-
|
|
334
|
-
typo={size === 'xs' ? '13' : '14'}
|
|
346
|
+
typo={getTypography(size)}
|
|
335
347
|
>
|
|
336
348
|
{children}
|
|
337
349
|
</Text>
|
|
350
|
+
|
|
338
351
|
{rightContent}
|
|
339
352
|
</HStack>
|
|
340
353
|
</BaseButton>
|