@aspprev/versi-ds 0.4.1 → 0.4.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/README.md CHANGED
@@ -94,6 +94,8 @@ import {
94
94
  - `DatePicker` aceita `selectionMode="year"` e mantém `selectionMode="day"` como padrão.
95
95
  - `DomainStatusBadge` aceita `statusMap` para vocabulário específico do produto.
96
96
  - `Table` preserva os modos `fit`, `adaptive` e `scroll`; filtros e paginação respondem ao espaço do container.
97
+ - `InputPhone`/`PhoneInput` e `SelectCountry` aceitam `showFlags`; o padrão é `true` e `showFlags={false}` remove a bandeira sem reservar espaço.
98
+ - Os controles de formulário ocupam a largura disponível do container; `className="w-full"` pode ser usado em grids, flex containers e colunas responsivas.
97
99
 
98
100
  Consulte [`docs/API-NOVOS-COMPONENTES.md`](docs/API-NOVOS-COMPONENTES.md) e o Storybook para exemplos completos, estados de erro/carregamento e contratos de acessibilidade.
99
101
 
@@ -1780,7 +1780,8 @@ function buildPhonePayload(phoneValue) {
1780
1780
  function parsePhonePayload(rawValue, countries = PHONE_COUNTRY_OPTIONS) {
1781
1781
  return parseStoredPhoneValue(rawValue, countries);
1782
1782
  }
1783
- function renderFlag(option) {
1783
+ function renderFlag(option, showFlags) {
1784
+ if (!showFlags) return null;
1784
1785
  return /* @__PURE__ */ jsx6(
1785
1786
  CountryFlag,
1786
1787
  {
@@ -1798,7 +1799,8 @@ function InputPhone({
1798
1799
  countries,
1799
1800
  countryList,
1800
1801
  disabled,
1801
- className
1802
+ className,
1803
+ showFlags = true
1802
1804
  }) {
1803
1805
  const availableCountries = useMemo(
1804
1806
  () => filterCountryOptions(
@@ -1950,14 +1952,14 @@ function InputPhone({
1950
1952
  "div",
1951
1953
  {
1952
1954
  ref: wrapperRef,
1953
- className: "field-control-slot relative mt-4xs mb-[4px]",
1955
+ className: "field-control-slot relative mt-4xs mb-[4px] flex w-full min-w-0",
1954
1956
  children: [
1955
1957
  /* @__PURE__ */ jsxs5(
1956
1958
  "div",
1957
1959
  {
1958
1960
  "data-has-value": phoneDigits.length > 0,
1959
1961
  className: classNames5(
1960
- "field-keyboard-focus-ring flex min-h-control-md items-center overflow-hidden rounded-sm border border-field-border-default bg-field-surface text-field-icon transition-colors focus-within:border-field-border-active focus-within:text-field-content data-[has-value=true]:text-field-content",
1962
+ "field-keyboard-focus-ring flex w-full min-w-0 min-h-control-md items-center overflow-hidden rounded-sm border border-field-border-default bg-field-surface text-field-icon transition-colors focus-within:border-field-border-active focus-within:text-field-content data-[has-value=true]:text-field-content",
1961
1963
  {
1962
1964
  [FIELD_ERROR_CLASS]: hasError,
1963
1965
  [FIELD_DISABLED_CLASS]: disabled
@@ -1991,7 +1993,7 @@ function InputPhone({
1991
1993
  }
1992
1994
  ),
1993
1995
  children: [
1994
- renderFlag(selectedCountry),
1996
+ renderFlag(selectedCountry, showFlags),
1995
1997
  /* @__PURE__ */ jsx6("span", { className: "text-sm", children: selectedCountry?.idd.display || `+${value.ddi}` }),
1996
1998
  open ? /* @__PURE__ */ jsx6(
1997
1999
  MdOutlineKeyboardArrowUp2,
@@ -2128,7 +2130,7 @@ function InputPhone({
2128
2130
  },
2129
2131
  className: "flex w-full items-center gap-2 px-3 py-2 text-left text-sm hover:bg-surface-muted focus-visible:bg-surface-muted focus-visible:outline focus-visible:outline-2 focus-visible:outline-focus-ring",
2130
2132
  children: [
2131
- renderFlag(country),
2133
+ renderFlag(country, showFlags),
2132
2134
  /* @__PURE__ */ jsx6("span", { className: "min-w-0 flex-1 truncate text-field-content", children: country.label }),
2133
2135
  /* @__PURE__ */ jsx6("span", { className: "shrink-0 text-content-muted", children: country.idd.display })
2134
2136
  ]
@@ -2927,7 +2929,15 @@ import {
2927
2929
  import { MdClose, MdKeyboardArrowDown } from "react-icons/md";
2928
2930
  import { jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
2929
2931
  function SelectMultiView(props) {
2930
- const { options, error, label, checkedList = [], onClear, disabled } = props;
2932
+ const {
2933
+ options,
2934
+ error,
2935
+ label,
2936
+ checkedList = [],
2937
+ onClear,
2938
+ disabled,
2939
+ className
2940
+ } = props;
2931
2941
  const [isOpened, setIsOpened] = useState6(false);
2932
2942
  const containerRef = useRef6(null);
2933
2943
  const triggerRef = useRef6(null);
@@ -3007,7 +3017,7 @@ function SelectMultiView(props) {
3007
3017
  FieldFrame_default,
3008
3018
  {
3009
3019
  ref: containerRef,
3010
- className: "multi-select-container",
3020
+ className: cs("multi-select-container", className),
3011
3021
  label,
3012
3022
  labelFor: triggerId,
3013
3023
  labelId: label ? labelId : void 0,
@@ -3018,7 +3028,7 @@ function SelectMultiView(props) {
3018
3028
  "div",
3019
3029
  {
3020
3030
  "aria-invalid": Boolean(error) || void 0,
3021
- className: "relative mb-[4px] mt-4xs",
3031
+ className: "relative mb-[4px] mt-4xs w-full min-w-0",
3022
3032
  children: [
3023
3033
  /* @__PURE__ */ jsxs7(
3024
3034
  "button",
@@ -3173,7 +3183,8 @@ var SelectMulti_default = SelectMulti;
3173
3183
 
3174
3184
  // src/components/selectCountry/SelectCountry.tsx
3175
3185
  import { jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
3176
- function renderFlag2(option) {
3186
+ function renderFlag2(option, showFlags) {
3187
+ if (!showFlags) return null;
3177
3188
  return /* @__PURE__ */ jsx10(
3178
3189
  "span",
3179
3190
  {
@@ -3190,12 +3201,12 @@ function renderFlag2(option) {
3190
3201
  }
3191
3202
  );
3192
3203
  }
3193
- function renderCountryContent(option, placeholder) {
3204
+ function renderCountryContent(option, placeholder, showFlags = true) {
3194
3205
  if (!option) {
3195
3206
  return /* @__PURE__ */ jsx10("span", { className: "block w-full truncate overflow-hidden text-content-muted", children: placeholder });
3196
3207
  }
3197
3208
  return /* @__PURE__ */ jsxs8("span", { className: "flex w-full min-w-0 items-center gap-2", children: [
3198
- renderFlag2(option),
3209
+ renderFlag2(option, showFlags),
3199
3210
  /* @__PURE__ */ jsx10("span", { className: "block truncate overflow-hidden", children: option.label })
3200
3211
  ] });
3201
3212
  }
@@ -3208,6 +3219,7 @@ function SelectCountry({
3208
3219
  defaultValue,
3209
3220
  onChange,
3210
3221
  className,
3222
+ showFlags = true,
3211
3223
  ...props
3212
3224
  }) {
3213
3225
  const availableOptions = filterCountryOptions(
@@ -3225,8 +3237,12 @@ function SelectCountry({
3225
3237
  searchable,
3226
3238
  searchPlaceholder,
3227
3239
  noOptionsText,
3228
- renderOption: (option) => renderCountryContent(option),
3229
- renderValue: (option, placeholder) => renderCountryContent(option, placeholder)
3240
+ renderOption: (option) => renderCountryContent(option, void 0, showFlags),
3241
+ renderValue: (option, placeholder) => renderCountryContent(
3242
+ option,
3243
+ placeholder,
3244
+ showFlags
3245
+ )
3230
3246
  }
3231
3247
  );
3232
3248
  }
@@ -3568,7 +3584,7 @@ var OtpCodeInput = forwardRef2(
3568
3584
  "aria-labelledby": label ? `${groupId}-label` : void 0,
3569
3585
  "aria-describedby": describedBy,
3570
3586
  "aria-invalid": hasError || void 0,
3571
- className: "mt-1 flex flex-wrap gap-2",
3587
+ className: "mt-1 flex w-full min-w-0 flex-wrap gap-2",
3572
3588
  children: Array.from({ length: safeLength }, (_, index) => /* @__PURE__ */ createElement(
3573
3589
  "input",
3574
3590
  {
@@ -3637,4 +3653,4 @@ export {
3637
3653
  RadioCardGroup,
3638
3654
  OtpCodeInput_default
3639
3655
  };
3640
- //# sourceMappingURL=chunk-6NVJWI5B.js.map
3656
+ //# sourceMappingURL=chunk-MC4MSOCM.js.map