@tapie-kr/inspire-react
Version:
React Component Collection for INSPIRE
24 lines (21 loc) • 1.08 kB
JavaScript
'use client';
/* eslint-disable */
/*
* INSPIRE : Creative Kit
* React Component Collection for INSPIRE
*
* This file is generated automatically. Do not modify it manually
* Generated at : 2025. 3. 4. 오후 6:18:13
* @tapie-kr/inspire-react version: 0.2.15
*
* (c) 2025 TAPIE. All rights reserved.
* MIT License
*/
import { jsx } from 'react/jsx-runtime';
import { segmentGroup } from './styles.css.js';
import { spacingVars } from '../../../lib/style/contract/component.css.js';
import { HStack } from '../../miscellaneous/layout/HStack/index.js';
import { useState, useCallback } from 'react';
import { SegmentGroupContext } from './context.js';
function SegmentGroup(props){const[currentValue,setCurrentValue]=useState(props.defaultValue);const handleChange=useCallback(value=>{setCurrentValue(value);props.onChange?.(value);},[props]);return jsx(SegmentGroupContext.Provider,{value:{value:currentValue,onChange:handleChange},children:jsx(HStack,{fullWidth:true,className:segmentGroup,spacing:spacingVars.mini,children:props.children})})}
export { SegmentGroup };