@basic-ui/material 1.0.0-alpha.49 → 1.0.0-alpha.50
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/build/cjs/index.js +70 -0
- package/build/cjs/index.js.map +1 -1
- package/build/esm/Chip/ButtonChip.d.ts +1 -1
- package/build/esm/SearchBar/SearchBar.d.ts +15 -0
- package/build/esm/SearchBar/SearchBar.js +90 -0
- package/build/esm/SearchBar/SearchBar.js.map +1 -0
- package/build/esm/SearchBar/index.d.ts +1 -0
- package/build/esm/SearchBar/index.js +2 -0
- package/build/esm/SearchBar/index.js.map +1 -0
- package/build/esm/Select/CustomContainerExample.d.ts +1 -1
- package/build/esm/Table/TableHead.d.ts +1 -1
- package/build/esm/TextField/IconContainer.js.map +1 -1
- package/build/esm/index.d.ts +1 -0
- package/build/esm/index.js +1 -0
- package/build/esm/index.js.map +1 -1
- package/build/tsconfig-build.tsbuildinfo +1 -1
- package/package.json +2 -3
- package/src/Combobox/Combobox.story.tsx +157 -157
- package/src/SearchBar/SearchBar.story.tsx +98 -0
- package/src/SearchBar/SearchBar.tsx +105 -0
- package/src/SearchBar/index.ts +1 -0
- package/src/TextField/IconContainer.tsx +33 -33
- package/src/TextField/TextField.story.tsx +240 -241
- package/src/index.ts +42 -41
package/build/cjs/index.js
CHANGED
|
@@ -4272,6 +4272,75 @@ const RadioGroup = /*#__PURE__*/react$1.forwardRef(function RadioGroup(props, fo
|
|
|
4272
4272
|
});
|
|
4273
4273
|
});
|
|
4274
4274
|
|
|
4275
|
+
const SearchBar = /*#__PURE__*/react$1.forwardRef(function SearchBar(props, forwardedRef) {
|
|
4276
|
+
const {
|
|
4277
|
+
type = 'text',
|
|
4278
|
+
id: idProp,
|
|
4279
|
+
color = 'primary',
|
|
4280
|
+
value: valueProp,
|
|
4281
|
+
defaultValue = '',
|
|
4282
|
+
error,
|
|
4283
|
+
onChange: onChangeProp,
|
|
4284
|
+
leadingIcon = null,
|
|
4285
|
+
trailingIcon = null,
|
|
4286
|
+
containerProps,
|
|
4287
|
+
variant,
|
|
4288
|
+
__css,
|
|
4289
|
+
...otherProps
|
|
4290
|
+
} = props;
|
|
4291
|
+
const {
|
|
4292
|
+
__css: __containerCss,
|
|
4293
|
+
...otherContainerProps
|
|
4294
|
+
} = containerProps || {};
|
|
4295
|
+
const [value, onChange] = core.useControlledState(valueProp, onChangeProp, defaultValue, setState => e => {
|
|
4296
|
+
setState(e.target.value);
|
|
4297
|
+
});
|
|
4298
|
+
const fallbackId = react$1.useId();
|
|
4299
|
+
const hasError = Boolean(error);
|
|
4300
|
+
const id = idProp || fallbackId;
|
|
4301
|
+
const inputId = `${id}-search-bar`;
|
|
4302
|
+
return /*#__PURE__*/jsxRuntime.jsxs(Box, {
|
|
4303
|
+
__css: {
|
|
4304
|
+
display: 'inline-flex',
|
|
4305
|
+
position: 'relative',
|
|
4306
|
+
...__containerCss
|
|
4307
|
+
},
|
|
4308
|
+
...otherContainerProps,
|
|
4309
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Input, {
|
|
4310
|
+
__css: {
|
|
4311
|
+
borderRadius: 'full',
|
|
4312
|
+
backgroundColor: 'surface-container-high',
|
|
4313
|
+
height: "3.5rem",
|
|
4314
|
+
pl: leadingIcon ? "3rem" : "1.5rem",
|
|
4315
|
+
pr: trailingIcon ? "3rem" : "1.5rem",
|
|
4316
|
+
py: 0,
|
|
4317
|
+
transition: `outline-color .2s ${EASING_STANDARD}`,
|
|
4318
|
+
outlineStyle: 'solid',
|
|
4319
|
+
outlineWidth: "0.125rem",
|
|
4320
|
+
outlineColor: 'transparent',
|
|
4321
|
+
outlineOffset: polished.rem(-1),
|
|
4322
|
+
'&:focus': {
|
|
4323
|
+
outlineColor: hasError ? 'error' : color
|
|
4324
|
+
},
|
|
4325
|
+
...__css
|
|
4326
|
+
},
|
|
4327
|
+
type: type,
|
|
4328
|
+
ref: forwardedRef,
|
|
4329
|
+
hasLabel: false,
|
|
4330
|
+
id: inputId,
|
|
4331
|
+
value: value,
|
|
4332
|
+
onChange: onChange,
|
|
4333
|
+
...otherProps
|
|
4334
|
+
}), leadingIcon && /*#__PURE__*/jsxRuntime.jsx(IconContainer, {
|
|
4335
|
+
position: "start",
|
|
4336
|
+
children: leadingIcon
|
|
4337
|
+
}), trailingIcon && /*#__PURE__*/jsxRuntime.jsx(IconContainer, {
|
|
4338
|
+
position: "end",
|
|
4339
|
+
children: trailingIcon
|
|
4340
|
+
})]
|
|
4341
|
+
});
|
|
4342
|
+
});
|
|
4343
|
+
|
|
4275
4344
|
const Select$1 = /*#__PURE__*/react$1.forwardRef(({
|
|
4276
4345
|
as: asProp = 'select',
|
|
4277
4346
|
...props
|
|
@@ -6091,6 +6160,7 @@ exports.RadioButton = RadioButton;
|
|
|
6091
6160
|
exports.RadioGroup = RadioGroup;
|
|
6092
6161
|
exports.Ripple = Ripple;
|
|
6093
6162
|
exports.RippleBox = RippleBox;
|
|
6163
|
+
exports.SearchBar = SearchBar;
|
|
6094
6164
|
exports.Select = Select;
|
|
6095
6165
|
exports.SelectItem = SelectItem;
|
|
6096
6166
|
exports.Skeleton = Skeleton;
|