@yeverlibs/ds 1.1.29 → 1.1.31

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/index.mjs CHANGED
@@ -8946,6 +8946,7 @@ var Input = forwardRef(
8946
8946
  $errorMessage,
8947
8947
  type = "text",
8948
8948
  $charactersLimit,
8949
+ $showCharactersLimit = true,
8949
8950
  $description,
8950
8951
  isNotProvided = false,
8951
8952
  wrapperClassName,
@@ -9000,7 +9001,7 @@ var Input = forwardRef(
9000
9001
  ]
9001
9002
  }
9002
9003
  ),
9003
- $charactersLimit && /* @__PURE__ */ jsxs("span", { className: "text-xs text-gray-600", children: [
9004
+ $charactersLimit && $showCharactersLimit && /* @__PURE__ */ jsxs("span", { className: "text-xs text-gray-600", children: [
9004
9005
  value.length,
9005
9006
  " de ",
9006
9007
  $charactersLimit,
@@ -11289,27 +11290,24 @@ var Counter = ({
11289
11290
  methods,
11290
11291
  onChange,
11291
11292
  id,
11292
- minValue = 0,
11293
11293
  ...rest
11294
11294
  }) => {
11295
11295
  const form = useForm();
11296
11296
  const { setValue, getValues, control } = methods || form;
11297
11297
  const fieldName = rest.name || "counter";
11298
- const defaultValue = rest.defaultValue ? Math.max(Number(rest.defaultValue), minValue) : minValue;
11298
+ const defaultValue = rest.defaultValue ? Number(rest.defaultValue) : 0;
11299
11299
  const handleIncrement = () => {
11300
11300
  if (!hasDisabled) {
11301
- const currentValue = getValues(fieldName);
11302
- const numericValue = currentValue !== void 0 && currentValue !== null ? Number(currentValue) : minValue;
11303
- const newValue = Math.max(numericValue, minValue) + 1;
11301
+ const currentValue = getValues(fieldName) || 0;
11302
+ const newValue = Number(currentValue) + 1;
11304
11303
  setValue(fieldName, newValue);
11305
11304
  onChange?.(newValue);
11306
11305
  }
11307
11306
  };
11308
11307
  const handleDecrement = () => {
11309
11308
  if (!hasDisabled) {
11310
- const currentValue = getValues(fieldName);
11311
- const numericValue = currentValue !== void 0 && currentValue !== null ? Number(currentValue) : minValue;
11312
- const newValue = Math.max(numericValue, minValue) > minValue ? Math.max(numericValue, minValue) - 1 : minValue;
11309
+ const currentValue = getValues(fieldName) || 0;
11310
+ const newValue = Number(currentValue) > 0 ? Number(currentValue) - 1 : 0;
11313
11311
  setValue(fieldName, newValue);
11314
11312
  onChange?.(newValue);
11315
11313
  }
@@ -11357,11 +11355,11 @@ var Counter = ({
11357
11355
  ...fieldWithoutDefaultValue,
11358
11356
  id: fieldName,
11359
11357
  type: "number",
11360
- min: minValue,
11361
- value: field.value !== void 0 && field.value !== null ? Math.max(Number(field.value), minValue) : minValue,
11358
+ min: 1,
11359
+ value: field.value || 1,
11362
11360
  onChange: (e14) => {
11363
11361
  const newValue = Number(e14.target.value);
11364
- if (newValue >= minValue) {
11362
+ if (newValue >= 0) {
11365
11363
  field.onChange(newValue);
11366
11364
  onChange?.(newValue);
11367
11365
  }
@@ -11720,9 +11718,7 @@ var CustomSelect = ({
11720
11718
  isClearable = true
11721
11719
  }) => {
11722
11720
  const handleChange = (option) => {
11723
- if (option) {
11724
- onSelect(option);
11725
- }
11721
+ onSelect(option);
11726
11722
  };
11727
11723
  const formatOptionLabel = (option) => /* @__PURE__ */ jsxs("div", { className: "flex items-center", children: [
11728
11724
  option.icon && /* @__PURE__ */ jsx("div", { className: "relative mr-2 flex h-[24px] max-h-[24px] w-[24px] max-w-[24px] items-center justify-center rounded border border-gray-300", children: /* @__PURE__ */ jsx(Image3, { src: option.icon, alt: option.label, fill: true, className: "p-1", quality: 100 }) }),
@@ -12055,6 +12051,8 @@ var TimeInput = ({
12055
12051
  ] })
12056
12052
  ] });
12057
12053
  };
12054
+
12055
+ // src/_design-system/helpers/formatTime.ts
12058
12056
  var formatTime = (time2) => {
12059
12057
  let timeInSeconds = 0;
12060
12058
  if (typeof time2 === "string") {
@@ -12203,26 +12201,7 @@ var TimerCounter = ({
12203
12201
  description && /* @__PURE__ */ jsx("span", { className: "text-xs text-gray-700", children: description })
12204
12202
  ] });
12205
12203
  };
12206
-
12207
- // src/_design-system/helpers/formatTime.ts
12208
12204
  var formatTime2 = (time2) => {
12209
- let timeInSeconds = 0;
12210
- if (typeof time2 === "string") {
12211
- if (time2.includes(":")) {
12212
- const [hours3, minutes3, seconds4] = time2.split(":").map(Number);
12213
- timeInSeconds = hours3 * 3600 + minutes3 * 60 + seconds4;
12214
- } else {
12215
- timeInSeconds = parseInt(time2, 10) || 0;
12216
- }
12217
- } else {
12218
- timeInSeconds = time2 || 0;
12219
- }
12220
- const hours2 = Math.floor(timeInSeconds / 3600);
12221
- const minutes2 = Math.floor(timeInSeconds % 3600 / 60);
12222
- const seconds3 = timeInSeconds % 60;
12223
- return `${hours2.toString().padStart(2, "0")}:${minutes2.toString().padStart(2, "0")}:${seconds3.toString().padStart(2, "0")}`;
12224
- };
12225
- var formatTime3 = (time2) => {
12226
12205
  let timeInSeconds = 0;
12227
12206
  if (typeof time2 === "string") {
12228
12207
  if (time2.includes(":")) {
@@ -12252,7 +12231,7 @@ var TimerCounterWithoutSeconds = ({
12252
12231
  const fieldName = rest.name || "timer";
12253
12232
  const { control, setValue, watch } = form;
12254
12233
  const rawValue = watch(fieldName, defaultValue || "00:00");
12255
- const displayValue = typeof rawValue === "number" ? formatTime3(rawValue) : rawValue || "00:00";
12234
+ const displayValue = typeof rawValue === "number" ? formatTime2(rawValue) : rawValue || "00:00";
12256
12235
  const parseTime = (timeString) => {
12257
12236
  if (!timeString) return 0;
12258
12237
  const [hours2, minutes2] = timeString.split(":").map(Number);
@@ -12266,7 +12245,7 @@ var TimerCounterWithoutSeconds = ({
12266
12245
  setValue(fieldName, "00:00", { shouldValidate: true, shouldDirty: true, shouldTouch: true });
12267
12246
  return;
12268
12247
  }
12269
- setValue(fieldName, formatTime3(newSeconds), { shouldValidate: true, shouldDirty: true, shouldTouch: true });
12248
+ setValue(fieldName, formatTime2(newSeconds), { shouldValidate: true, shouldDirty: true, shouldTouch: true });
12270
12249
  }
12271
12250
  };
12272
12251
  const handleDecrement = () => {
@@ -12274,7 +12253,7 @@ var TimerCounterWithoutSeconds = ({
12274
12253
  const currentSeconds = parseTime(displayValue);
12275
12254
  if (currentSeconds <= 0) return;
12276
12255
  const newSeconds = Math.max(0, currentSeconds - 3600);
12277
- setValue(fieldName, formatTime3(newSeconds), { shouldValidate: true, shouldDirty: true, shouldTouch: true });
12256
+ setValue(fieldName, formatTime2(newSeconds), { shouldValidate: true, shouldDirty: true, shouldTouch: true });
12278
12257
  }
12279
12258
  };
12280
12259
  const handleChanges = (e14) => {
@@ -12406,8 +12385,8 @@ function FileUploadComponent({
12406
12385
  const isImagePreview = useCallback((preview) => {
12407
12386
  if (!preview || typeof preview !== "string") return false;
12408
12387
  if (preview.startsWith("data:image/")) return true;
12409
- if (preview.startsWith("http") && preview.match(/\.(jpg|jpeg|png|gif|webp|svg|avif|bmp|tiff)/i)) return true;
12410
- if (preview.match(/\.(jpg|jpeg|png|gif|webp|svg|avif|bmp|tiff)$/i)) return true;
12388
+ if (preview.startsWith("http") && preview.match(/\.(jpg|jpeg|png|gif|webp|svg|bmp|tiff)/i)) return true;
12389
+ if (preview.match(/\.(jpg|jpeg|png|gif|webp|svg|bmp|tiff)$/i)) return true;
12411
12390
  return false;
12412
12391
  }, []);
12413
12392
  useEffect(() => {
@@ -26587,6 +26566,6 @@ object-assign/index.js:
26587
26566
  *)
26588
26567
  */
26589
26568
 
26590
- export { Alert, AlertDefault_default as AlertDefault, AlertError_default as AlertError, AlertGuard_default as AlertGuard, AlertInfo_default as AlertInfo, AlertWarning_default as AlertWarning, Api_default as Api, ArrowLeft_default as ArrowLeft, ArrowNarrowUpRight_default as ArrowNarrowUpRight, Avatar, BarChart, Boleto_default as Boleto, Box, Button, button_toggle_group_default as ButtonToggleGroup, CSV_default as CSV, Calendar_default as Calendar, Card_default as Card, CarrFree_default as CarrFree, CarretDown_default as CarretDown, CarretSingleRight_default as CarretSingleRight, CarrinhoAbandonado_default as CarrinhoAbandonado, Cart_default as Cart, Chargeback_default as Chargeback, Check_default as Check, Checkbox, checkbox_group_default as CheckboxGroup, Checkout_default as Checkout, ChevronDown_default as ChevronDown, ChevronLeftDouble_default as ChevronLeftDouble, CloseCheckbox_default as CloseCheckbox, CloseIcon_default as CloseIcon, Cloud_default as Cloud, CodeCircle_default as CodeCircle, Configuracoes_default as Configuracoes, Copy_default as Copy, CopyLink_default as CopyLink, Counter, CreditCard_default as CreditCard, Cupom_default as Cupom, CurrencyInput, CustomSelect, Dashboard_default as Dashboard, datapicker_default as DatePicker, Delivery_default as Delivery, Depoimentos_default as Depoimentos, Distribuicao_default as Distribuicao, Distribution_default as Distribution, Dominios_default as Dominios, DownloadArrow_default as DownloadArrow, Drag_default as Drag, DropdownContext, DropdownItens, DropdownTrigger, DrowpdownButton, Edit_default as Edit, Emails_default as Emails, Extrato_default as Extrato, EyeInput_default as EyeInput, EyeOff_default as EyeOff, FeedbackBadge, FileMinus_default as FileMinus, FileUploadWithDisplayName as FileUpload, FilterDrawer, FilterLines_default as FilterLines, FilterList, FilterListContext, FilterTrigger, Financeiro_default as Financeiro, FormWrapper, Frete_default as Frete, FreteGratis_default as FreteGratis, GeneralPageLinks, Gestao_default as Gestao, Globe_default as Globe, GlobeVariant_default as GlobeVariant, Grid, GridColumn, Guard_default as Guard, Heading, Headphones_default as Headphones, Help_default as Help, HelpCircle_default as HelpCircle, Home_default as Home, InfoCircle_default as InfoCircle, Input, Integracoes_default as Integracoes, LineChart, Link4 as Link, Link_default as LinkIcon, LoadingSpinner_default as LoadingSpinner, Lock_default as Lock, LockInput_default as LockInput, Logistica_default as Logistica, Loja_default as Loja, LojaAlert_default as LojaAlert, LojaAlertSuccess_default as LojaAlertSuccess, Mail_default as Mail, MailInput_default as MailInput, MarkerPin_default as MarkerPin, Marketing_default as Marketing, MediumRisk_default as MediumRisk, Message_default as Message, Modal, Money_default as Money, MultiSelect, icones_default as NewIcons, NewMessage_default as NewMessage, NewNotification_default as NewNotification, Notificacoes_default as Notificacoes, Notification_default as Notification, NotificationItem, Notifications_default as Notifications, OrderBump_default as OrderBump, PageContainer, PaymentCard, PermissaoDeAcesso_default as PermissaoDeAcesso, PhoneCall_default as PhoneCall, PieChart, Pix_default as Pix, Pixels_default as Pixels, Planilha_default as Planilha, Plus_default as Plus, Prechargeback_default as Prechargeback, PrefetchLink, PreviewPhone, PriceSkeleton, Produto_default as Produto, Produtos_default as Produtos, Promocoes_default as Promocoes, RecuperacaoDeCarrinho_default as RecuperacaoDeCarrinho, Refresh_default as Refresh, Relatorios_default as Relatorios, RestricaoDeAcesso_default as RestricaoDeAcesso, Ribbon, Risco_default as Risco, Sac_default as Sac, SearchMd_default as SearchMd, SelectableOption, Separator, Signout_default as Signout, SliderInput, SlidingPanel, Spinner2 as Spinner, Spinner_default as SpinnerIcon, StatusBadge, Store_default as Store, Switch2 as Switch, Switch_default as SwitchIcon, Table, Tabs, Text, Textarea, TimeInput, TimerCounter, TimerCounterWithoutSeconds, Tooltip, Transfer_default as Transfer, Trash_default as Trash, Truck_default as Truck, Upsell_default as Upsell, User_default as User, Users_default as Users, VerticalPoints_default as VerticalPoints, Warning_default as Warning, Webhook_default2 as Webhook, Webhook_default as WebhookConfig, Whatsapp_default as Whatsapp, Xlsx_default as Xlsx, Yever_default as Yever, calculateCurrencyOperation, cn, colors_default2 as colors, font_family_default as fontFamily, formatCNPJ, formatCNPJCPF, formatCPF, formatCurrency, formatCurrencyShort, formatDate, formatDateAndReturnPassedHours, formatDateGeneric, formatDateInPassedDays, formatDateTime, formatDateToISO, formatIP, formatName, formatNumberToCurrency, formatPhone, formatPostalCode, formatRawDigitsToCurrency, formatTime2 as formatTime, formatTime3 as formatTimeWithoutSeconds, getDates, handleFormSubmission, iconList, nextReplaceUrl, parseFormattedCurrency, parseParametersIntoUrl, searchParamsToUrl, shadow_default as shadow, transformDateToAmericanFormat, transformToCurrency, transformToNumber, transformToPercentage, truncateString, useCopyToClipboard, useFetchClientSide };
26569
+ export { Alert, AlertDefault_default as AlertDefault, AlertError_default as AlertError, AlertGuard_default as AlertGuard, AlertInfo_default as AlertInfo, AlertWarning_default as AlertWarning, Api_default as Api, ArrowLeft_default as ArrowLeft, ArrowNarrowUpRight_default as ArrowNarrowUpRight, Avatar, BarChart, Boleto_default as Boleto, Box, Button, button_toggle_group_default as ButtonToggleGroup, CSV_default as CSV, Calendar_default as Calendar, Card_default as Card, CarrFree_default as CarrFree, CarretDown_default as CarretDown, CarretSingleRight_default as CarretSingleRight, CarrinhoAbandonado_default as CarrinhoAbandonado, Cart_default as Cart, Chargeback_default as Chargeback, Check_default as Check, Checkbox, checkbox_group_default as CheckboxGroup, Checkout_default as Checkout, ChevronDown_default as ChevronDown, ChevronLeftDouble_default as ChevronLeftDouble, CloseCheckbox_default as CloseCheckbox, CloseIcon_default as CloseIcon, Cloud_default as Cloud, CodeCircle_default as CodeCircle, Configuracoes_default as Configuracoes, Copy_default as Copy, CopyLink_default as CopyLink, Counter, CreditCard_default as CreditCard, Cupom_default as Cupom, CurrencyInput, CustomSelect, Dashboard_default as Dashboard, datapicker_default as DatePicker, Delivery_default as Delivery, Depoimentos_default as Depoimentos, Distribuicao_default as Distribuicao, Distribution_default as Distribution, Dominios_default as Dominios, DownloadArrow_default as DownloadArrow, Drag_default as Drag, DropdownContext, DropdownItens, DropdownTrigger, DrowpdownButton, Edit_default as Edit, Emails_default as Emails, Extrato_default as Extrato, EyeInput_default as EyeInput, EyeOff_default as EyeOff, FeedbackBadge, FileMinus_default as FileMinus, FileUploadWithDisplayName as FileUpload, FilterDrawer, FilterLines_default as FilterLines, FilterList, FilterListContext, FilterTrigger, Financeiro_default as Financeiro, FormWrapper, Frete_default as Frete, FreteGratis_default as FreteGratis, GeneralPageLinks, Gestao_default as Gestao, Globe_default as Globe, GlobeVariant_default as GlobeVariant, Grid, GridColumn, Guard_default as Guard, Heading, Headphones_default as Headphones, Help_default as Help, HelpCircle_default as HelpCircle, Home_default as Home, InfoCircle_default as InfoCircle, Input, Integracoes_default as Integracoes, LineChart, Link4 as Link, Link_default as LinkIcon, LoadingSpinner_default as LoadingSpinner, Lock_default as Lock, LockInput_default as LockInput, Logistica_default as Logistica, Loja_default as Loja, LojaAlert_default as LojaAlert, LojaAlertSuccess_default as LojaAlertSuccess, Mail_default as Mail, MailInput_default as MailInput, MarkerPin_default as MarkerPin, Marketing_default as Marketing, MediumRisk_default as MediumRisk, Message_default as Message, Modal, Money_default as Money, MultiSelect, icones_default as NewIcons, NewMessage_default as NewMessage, NewNotification_default as NewNotification, Notificacoes_default as Notificacoes, Notification_default as Notification, NotificationItem, Notifications_default as Notifications, OrderBump_default as OrderBump, PageContainer, PaymentCard, PermissaoDeAcesso_default as PermissaoDeAcesso, PhoneCall_default as PhoneCall, PieChart, Pix_default as Pix, Pixels_default as Pixels, Planilha_default as Planilha, Plus_default as Plus, Prechargeback_default as Prechargeback, PrefetchLink, PreviewPhone, PriceSkeleton, Produto_default as Produto, Produtos_default as Produtos, Promocoes_default as Promocoes, RecuperacaoDeCarrinho_default as RecuperacaoDeCarrinho, Refresh_default as Refresh, Relatorios_default as Relatorios, RestricaoDeAcesso_default as RestricaoDeAcesso, Ribbon, Risco_default as Risco, Sac_default as Sac, SearchMd_default as SearchMd, SelectableOption, Separator, Signout_default as Signout, SliderInput, SlidingPanel, Spinner2 as Spinner, Spinner_default as SpinnerIcon, StatusBadge, Store_default as Store, Switch2 as Switch, Switch_default as SwitchIcon, Table, Tabs, Text, Textarea, TimeInput, TimerCounter, TimerCounterWithoutSeconds, Tooltip, Transfer_default as Transfer, Trash_default as Trash, Truck_default as Truck, Upsell_default as Upsell, User_default as User, Users_default as Users, VerticalPoints_default as VerticalPoints, Warning_default as Warning, Webhook_default2 as Webhook, Webhook_default as WebhookConfig, Whatsapp_default as Whatsapp, Xlsx_default as Xlsx, Yever_default as Yever, calculateCurrencyOperation, cn, colors_default2 as colors, font_family_default as fontFamily, formatCNPJ, formatCNPJCPF, formatCPF, formatCurrency, formatCurrencyShort, formatDate, formatDateAndReturnPassedHours, formatDateGeneric, formatDateInPassedDays, formatDateTime, formatDateToISO, formatIP, formatName, formatNumberToCurrency, formatPhone, formatPostalCode, formatRawDigitsToCurrency, formatTime, formatTime2 as formatTimeWithoutSeconds, getDates, handleFormSubmission, iconList, nextReplaceUrl, parseFormattedCurrency, parseParametersIntoUrl, searchParamsToUrl, shadow_default as shadow, transformDateToAmericanFormat, transformToCurrency, transformToNumber, transformToPercentage, truncateString, useCopyToClipboard, useFetchClientSide };
26591
26570
  //# sourceMappingURL=index.mjs.map
26592
26571
  //# sourceMappingURL=index.mjs.map