@clubmed/trident-ui 1.2.0-beta.2 → 1.2.0-beta.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/atoms/Icons/Icon.d.ts +5 -1
  3. package/atoms/Icons/Icon.js +3 -2
  4. package/atoms/Icons/Icon.js.map +1 -1
  5. package/atoms/Icons/Iconics.d.ts +9 -1
  6. package/atoms/Icons/Iconics.js +1 -1
  7. package/atoms/Icons/IconsResolver.d.ts +33 -1
  8. package/atoms/Icons/IconsResolver.js +6 -5
  9. package/atoms/Icons/IconsResolver.js.map +1 -1
  10. package/atoms/Icons/contexts/IconsContext.d.ts +8 -1
  11. package/atoms/Icons/contexts/IconsContext.js +8 -1
  12. package/atoms/Icons/contexts/IconsContext.js.map +1 -1
  13. package/atoms/Icons/index.js +8 -6
  14. package/atoms/Icons/index.js.map +1 -1
  15. package/atoms/Icons/svg/SvgIcon.d.ts +9 -1
  16. package/atoms/Icons/svg/SvgIcon.js +5 -1
  17. package/atoms/Icons/svg/SvgIcon.js.map +1 -1
  18. package/atoms/Icons/svg/SvgIconResolver.d.ts +5 -1
  19. package/atoms/Icons/svg/SvgIconResolver.js +5 -1
  20. package/atoms/Icons/svg/SvgIconResolver.js.map +1 -1
  21. package/atoms/Icons/svg/index.d.ts +2 -1
  22. package/atoms/Icons/svg/index.js +6 -2
  23. package/atoms/Icons/svg-use/SvgUseIcon.d.ts +9 -1
  24. package/atoms/Icons/svg-use/SvgUseIcon.js +5 -1
  25. package/atoms/Icons/svg-use/SvgUseIcon.js.map +1 -1
  26. package/atoms/Icons/svg-use/SvgUseIconResolver.d.ts +5 -1
  27. package/atoms/Icons/svg-use/SvgUseIconResolver.js +5 -1
  28. package/atoms/Icons/svg-use/SvgUseIconResolver.js.map +1 -1
  29. package/atoms/Icons/svg-use/index.d.ts +2 -1
  30. package/atoms/Icons/svg-use/index.js +6 -2
  31. package/molecules/Breadcrumb.js +9 -8
  32. package/molecules/Breadcrumb.js.map +1 -1
  33. package/molecules/Buttons/ButtonContent.js +6 -5
  34. package/molecules/Buttons/ButtonContent.js.map +1 -1
  35. package/molecules/Card.js +8 -7
  36. package/molecules/Card.js.map +1 -1
  37. package/molecules/Forms/Checkboxes/Checkbox.js +13 -12
  38. package/molecules/Forms/Checkboxes/Checkbox.js.map +1 -1
  39. package/molecules/Forms/DateField.js +4 -3
  40. package/molecules/Forms/DateField.js.map +1 -1
  41. package/molecules/Forms/Filter.js +13 -12
  42. package/molecules/Forms/Filter.js.map +1 -1
  43. package/molecules/Forms/FormControl.js +16 -15
  44. package/molecules/Forms/FormControl.js.map +1 -1
  45. package/molecules/Forms/Password/Password.js +11 -10
  46. package/molecules/Forms/Password/Password.js.map +1 -1
  47. package/molecules/Forms/Password/ValidationMessage.js +9 -8
  48. package/molecules/Forms/Password/ValidationMessage.js.map +1 -1
  49. package/molecules/Forms/Select.js +4 -3
  50. package/molecules/Forms/Select.js.map +1 -1
  51. package/molecules/Forms/TextField.js +8 -7
  52. package/molecules/Forms/TextField.js.map +1 -1
  53. package/molecules/Link.js +9 -8
  54. package/molecules/Link.js.map +1 -1
  55. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"DateField.js","sources":["../../../node_modules/@babel/runtime/helpers/esm/typeof.js","../../../node_modules/date-fns/esm/_lib/requiredArgs/index.js","../../../node_modules/date-fns/esm/toDate/index.js","../../../node_modules/date-fns/esm/_lib/addLeadingZeros/index.js","../../../node_modules/date-fns/esm/formatISO/index.js","../../../lib/molecules/Forms/DateField.tsx"],"sourcesContent":["export default function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}","export default function requiredArgs(required, args) {\n if (args.length < required) {\n throw new TypeError(required + ' argument' + (required > 1 ? 's' : '') + ' required, but only ' + args.length + ' present');\n }\n}","import _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name toDate\n * @category Common Helpers\n * @summary Convert the given argument to an instance of Date.\n *\n * @description\n * Convert the given argument to an instance of Date.\n *\n * If the argument is an instance of Date, the function returns its clone.\n *\n * If the argument is a number, it is treated as a timestamp.\n *\n * If the argument is none of the above, the function returns Invalid Date.\n *\n * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.\n *\n * @param {Date|Number} argument - the value to convert\n * @returns {Date} the parsed date in the local time zone\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Clone the date:\n * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))\n * //=> Tue Feb 11 2014 11:30:30\n *\n * @example\n * // Convert the timestamp to date:\n * const result = toDate(1392098430000)\n * //=> Tue Feb 11 2014 11:30:30\n */\nexport default function toDate(argument) {\n requiredArgs(1, arguments);\n var argStr = Object.prototype.toString.call(argument);\n\n // Clone the date\n if (argument instanceof Date || _typeof(argument) === 'object' && argStr === '[object Date]') {\n // Prevent the date to lose the milliseconds when passed to new Date() in IE10\n return new Date(argument.getTime());\n } else if (typeof argument === 'number' || argStr === '[object Number]') {\n return new Date(argument);\n } else {\n if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {\n // eslint-disable-next-line no-console\n console.warn(\"Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments\");\n // eslint-disable-next-line no-console\n console.warn(new Error().stack);\n }\n return new Date(NaN);\n }\n}","export default function addLeadingZeros(number, targetLength) {\n var sign = number < 0 ? '-' : '';\n var output = Math.abs(number).toString();\n while (output.length < targetLength) {\n output = '0' + output;\n }\n return sign + output;\n}","import toDate from \"../toDate/index.js\";\nimport addLeadingZeros from \"../_lib/addLeadingZeros/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name formatISO\n * @category Common Helpers\n * @summary Format the date according to the ISO 8601 standard (https://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a003169814.htm).\n *\n * @description\n * Return the formatted date string in ISO 8601 format. Options may be passed to control the parts and notations of the date.\n *\n * @param {Date|Number} date - the original date\n * @param {Object} [options] - an object with options.\n * @param {'extended'|'basic'} [options.format='extended'] - if 'basic', hide delimiters between date and time values.\n * @param {'complete'|'date'|'time'} [options.representation='complete'] - format date, time with local time zone, or both.\n * @returns {String} the formatted date string (in local time zone)\n * @throws {TypeError} 1 argument required\n * @throws {RangeError} `date` must not be Invalid Date\n * @throws {RangeError} `options.format` must be 'extended' or 'basic'\n * @throws {RangeError} `options.representation` must be 'date', 'time' or 'complete'\n *\n * @example\n * // Represent 18 September 2019 in ISO 8601 format (local time zone is UTC):\n * const result = formatISO(new Date(2019, 8, 18, 19, 0, 52))\n * //=> '2019-09-18T19:00:52Z'\n *\n * @example\n * // Represent 18 September 2019 in ISO 8601, short format (local time zone is UTC):\n * const result = formatISO(new Date(2019, 8, 18, 19, 0, 52), { format: 'basic' })\n * //=> '20190918T190052'\n *\n * @example\n * // Represent 18 September 2019 in ISO 8601 format, date only:\n * const result = formatISO(new Date(2019, 8, 18, 19, 0, 52), { representation: 'date' })\n * //=> '2019-09-18'\n *\n * @example\n * // Represent 18 September 2019 in ISO 8601 format, time only (local time zone is UTC):\n * const result = formatISO(new Date(2019, 8, 18, 19, 0, 52), { representation: 'time' })\n * //=> '19:00:52Z'\n */\nexport default function formatISO(date, options) {\n var _options$format, _options$representati;\n requiredArgs(1, arguments);\n var originalDate = toDate(date);\n if (isNaN(originalDate.getTime())) {\n throw new RangeError('Invalid time value');\n }\n var format = String((_options$format = options === null || options === void 0 ? void 0 : options.format) !== null && _options$format !== void 0 ? _options$format : 'extended');\n var representation = String((_options$representati = options === null || options === void 0 ? void 0 : options.representation) !== null && _options$representati !== void 0 ? _options$representati : 'complete');\n if (format !== 'extended' && format !== 'basic') {\n throw new RangeError(\"format must be 'extended' or 'basic'\");\n }\n if (representation !== 'date' && representation !== 'time' && representation !== 'complete') {\n throw new RangeError(\"representation must be 'date', 'time', or 'complete'\");\n }\n var result = '';\n var tzOffset = '';\n var dateDelimiter = format === 'extended' ? '-' : '';\n var timeDelimiter = format === 'extended' ? ':' : '';\n\n // Representation is either 'date' or 'complete'\n if (representation !== 'time') {\n var day = addLeadingZeros(originalDate.getDate(), 2);\n var month = addLeadingZeros(originalDate.getMonth() + 1, 2);\n var year = addLeadingZeros(originalDate.getFullYear(), 4);\n\n // yyyyMMdd or yyyy-MM-dd.\n result = \"\".concat(year).concat(dateDelimiter).concat(month).concat(dateDelimiter).concat(day);\n }\n\n // Representation is either 'time' or 'complete'\n if (representation !== 'date') {\n // Add the timezone.\n var offset = originalDate.getTimezoneOffset();\n if (offset !== 0) {\n var absoluteOffset = Math.abs(offset);\n var hourOffset = addLeadingZeros(Math.floor(absoluteOffset / 60), 2);\n var minuteOffset = addLeadingZeros(absoluteOffset % 60, 2);\n // If less than 0, the sign is +, because it is ahead of time.\n var sign = offset < 0 ? '+' : '-';\n tzOffset = \"\".concat(sign).concat(hourOffset, \":\").concat(minuteOffset);\n } else {\n tzOffset = 'Z';\n }\n var hour = addLeadingZeros(originalDate.getHours(), 2);\n var minute = addLeadingZeros(originalDate.getMinutes(), 2);\n var second = addLeadingZeros(originalDate.getSeconds(), 2);\n\n // If there's also date, separate it with time with 'T'\n var separator = result === '' ? '' : 'T';\n\n // Creates a time string consisting of hour, minute, and second, separated by delimiters, if defined.\n var time = [hour, minute, second].join(timeDelimiter);\n\n // HHmmss or HH:mm:ss.\n result = \"\".concat(result).concat(separator).concat(time).concat(tzOffset);\n }\n return result;\n}","import classnames from 'classnames';\nimport { formatISO } from 'date-fns';\nimport { type ChangeEvent, useId, useRef } from 'react';\nimport { Icon, type IconicNames, type IconicTypes } from '@/atoms/Icons';\n\nimport { useValue } from '@/hooks/useValue.js';\nimport { useInternalStatus } from '@/hooks/useInternalStatus.js';\nimport { FormControl, type FormControlProps } from './FormControl.js';\n\ninterface DateFieldProps extends Omit<FormControlProps<Date | null>, 'max' | 'min'> {\n description?: string;\n /**\n * Open datepicker text\n */\n openDatepicker?: string;\n id?: string;\n icon?: IconicNames;\n iconType?: IconicTypes;\n errorMessage?: string;\n dataTestId?: string;\n /**\n * Minimum Date allowed\n */\n min?: Date | undefined;\n /**\n * Maximum Date allowed\n */\n max?: Date | undefined;\n}\n\nconst formatDate = (value: Date | number | undefined | null): string => {\n if (!value) {\n return '';\n }\n\n return formatISO(new Date(value), { representation: 'date' });\n};\n\nexport const DateField = (props: DateFieldProps) => {\n const internalId = useId();\n\n const {\n id = internalId,\n name = id,\n label,\n description,\n openDatepicker,\n validationStatus = 'default',\n icon = 'CalendarDefault',\n iconType,\n errorMessage,\n disabled = false,\n required = false,\n hideRequiredStar,\n dataTestId = 'DateField',\n value: initialValue,\n min: initialMin,\n max: initialMax,\n onChange,\n ...rest\n } = props;\n\n // NO LOGIC IS IMPLEMENTED YET HERE\n // THIS IS A VISUAL COMPONENT ONLY\n const ref = useRef<HTMLInputElement>(null);\n const internalStatus = useInternalStatus({\n isDisabled: disabled,\n validationStatus,\n });\n\n const { setValue, value } = useValue<string, Date | number | undefined | null>({\n name,\n formatter: formatDate as never,\n initialValue,\n onChange: (name, value) => onChange?.(name, new Date(value)),\n });\n\n const min = formatDate(initialMin);\n const max = formatDate(initialMax);\n\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\n setValue(event.target.value);\n };\n\n const handleClickPicker = () => {\n ref.current?.showPicker();\n };\n\n return (\n <FormControl\n id={id}\n label={label}\n description={description}\n dataName=\"DateField\"\n dataTestId={dataTestId}\n disabled={disabled}\n required={required}\n hideRequiredStar={hideRequiredStar}\n validationStatus={validationStatus}\n errorMessage={errorMessage}\n >\n <div className=\"relative\">\n <input\n {...rest}\n type=\"date\"\n className={classnames(\n 'text-b3 rounded-pill date-field min-h-[50px] w-full border px-20 py-12 ps-[52px] font-normal outline-none',\n {\n 'border-lightGrey focus:border-black active:border-black':\n internalStatus === 'default',\n 'pe-[52px]': internalStatus === 'error' || internalStatus === 'success',\n 'bg-pearl text-grey': disabled,\n 'bg-white text-black': !disabled,\n 'border-red': !disabled && internalStatus === 'error',\n 'border-green': !disabled && internalStatus === 'success',\n },\n )}\n id={id}\n disabled={disabled}\n required={required}\n ref={ref}\n value={value}\n min={min}\n max={max}\n onChange={handleChange}\n />\n <div\n className={classnames(\n 'pointer-events-none absolute inset-0 flex items-center justify-between px-20 py-12',\n {\n 'text-grey': disabled,\n 'text-red': !disabled && internalStatus === 'error',\n 'text-green': !disabled && internalStatus === 'success',\n },\n )}\n >\n <button className=\"pointer-events-auto leading-none\" onClick={handleClickPicker}>\n <Icon name={icon} iconType={iconType} width=\"24px\" />\n <span className=\"sr-only\">\n {openDatepicker}\n {/* REPLACE THAT WITH SOMETHING LIKE \"OPEN DATEPICKER\" SOONER RATHER THAN LATER PLZ */}\n </span>\n </button>\n <span className=\"ms-auto flex gap-x-8\">\n {internalStatus === 'error' && <Icon name=\"CrossDefault\" width=\"24px\" />}\n {internalStatus === 'success' && <Icon name=\"CheckDefault\" width=\"24px\" />}\n </span>\n </div>\n </div>\n </FormControl>\n );\n};\n"],"names":["_typeof","o","requiredArgs","required","args","toDate","argument","argStr","addLeadingZeros","number","targetLength","sign","output","formatISO","date","options","_options$format","_options$representati","originalDate","format","representation","result","tzOffset","dateDelimiter","timeDelimiter","day","month","year","offset","absoluteOffset","hourOffset","minuteOffset","hour","minute","second","separator","time","formatDate","value","DateField","props","internalId","useId","id","name","label","description","openDatepicker","validationStatus","icon","iconType","errorMessage","disabled","hideRequiredStar","dataTestId","initialValue","initialMin","initialMax","onChange","rest","ref","useRef","internalStatus","useInternalStatus","setValue","useValue","min","max","handleChange","event","handleClickPicker","_a","jsx","FormControl","jsxs","classnames","Icon"],"mappings":";;;;;;;AAAe,SAASA,EAAQC,GAAG;AAC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U,oCAAmC,SAASJ,GAC5D,UAAA;AAAA,gBAAA,gBAAAE,EAACI,GAAK,EAAA,MAAM3B,GAAM,UAAAC,GAAoB,OAAM,QAAO;AAAA,gBAClD,gBAAAsB,EAAA,QAAA,EAAK,WAAU,WACb,UAEHzB,GAAA;AAAA,cAAA,GACF;AAAA,cACA,gBAAA2B,EAAC,QAAK,EAAA,WAAU,wBACb,UAAA;AAAA,gBAAAZ,MAAmB,WAAY,gBAAAU,EAAAI,GAAA,EAAK,MAAK,gBAAe,OAAM,QAAO;AAAA,gBACrEd,MAAmB,aAAa,gBAAAU,EAACI,KAAK,MAAK,gBAAe,OAAM,QAAO;AAAA,cAAA,GAC1E;AAAA,YAAA;AAAA,UAAA;AAAA,QACF;AAAA,MAAA,GACF;AAAA,IAAA;AAAA,EAAA;AAGN;","x_google_ignoreList":[0,1,2,3,4]}
1
+ {"version":3,"file":"DateField.js","sources":["../../../node_modules/@babel/runtime/helpers/esm/typeof.js","../../../node_modules/date-fns/esm/_lib/requiredArgs/index.js","../../../node_modules/date-fns/esm/toDate/index.js","../../../node_modules/date-fns/esm/_lib/addLeadingZeros/index.js","../../../node_modules/date-fns/esm/formatISO/index.js","../../../lib/molecules/Forms/DateField.tsx"],"sourcesContent":["export default function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}","export default function requiredArgs(required, args) {\n if (args.length < required) {\n throw new TypeError(required + ' argument' + (required > 1 ? 's' : '') + ' required, but only ' + args.length + ' present');\n }\n}","import _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name toDate\n * @category Common Helpers\n * @summary Convert the given argument to an instance of Date.\n *\n * @description\n * Convert the given argument to an instance of Date.\n *\n * If the argument is an instance of Date, the function returns its clone.\n *\n * If the argument is a number, it is treated as a timestamp.\n *\n * If the argument is none of the above, the function returns Invalid Date.\n *\n * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.\n *\n * @param {Date|Number} argument - the value to convert\n * @returns {Date} the parsed date in the local time zone\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Clone the date:\n * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))\n * //=> Tue Feb 11 2014 11:30:30\n *\n * @example\n * // Convert the timestamp to date:\n * const result = toDate(1392098430000)\n * //=> Tue Feb 11 2014 11:30:30\n */\nexport default function toDate(argument) {\n requiredArgs(1, arguments);\n var argStr = Object.prototype.toString.call(argument);\n\n // Clone the date\n if (argument instanceof Date || _typeof(argument) === 'object' && argStr === '[object Date]') {\n // Prevent the date to lose the milliseconds when passed to new Date() in IE10\n return new Date(argument.getTime());\n } else if (typeof argument === 'number' || argStr === '[object Number]') {\n return new Date(argument);\n } else {\n if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {\n // eslint-disable-next-line no-console\n console.warn(\"Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments\");\n // eslint-disable-next-line no-console\n console.warn(new Error().stack);\n }\n return new Date(NaN);\n }\n}","export default function addLeadingZeros(number, targetLength) {\n var sign = number < 0 ? '-' : '';\n var output = Math.abs(number).toString();\n while (output.length < targetLength) {\n output = '0' + output;\n }\n return sign + output;\n}","import toDate from \"../toDate/index.js\";\nimport addLeadingZeros from \"../_lib/addLeadingZeros/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name formatISO\n * @category Common Helpers\n * @summary Format the date according to the ISO 8601 standard (https://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a003169814.htm).\n *\n * @description\n * Return the formatted date string in ISO 8601 format. Options may be passed to control the parts and notations of the date.\n *\n * @param {Date|Number} date - the original date\n * @param {Object} [options] - an object with options.\n * @param {'extended'|'basic'} [options.format='extended'] - if 'basic', hide delimiters between date and time values.\n * @param {'complete'|'date'|'time'} [options.representation='complete'] - format date, time with local time zone, or both.\n * @returns {String} the formatted date string (in local time zone)\n * @throws {TypeError} 1 argument required\n * @throws {RangeError} `date` must not be Invalid Date\n * @throws {RangeError} `options.format` must be 'extended' or 'basic'\n * @throws {RangeError} `options.representation` must be 'date', 'time' or 'complete'\n *\n * @example\n * // Represent 18 September 2019 in ISO 8601 format (local time zone is UTC):\n * const result = formatISO(new Date(2019, 8, 18, 19, 0, 52))\n * //=> '2019-09-18T19:00:52Z'\n *\n * @example\n * // Represent 18 September 2019 in ISO 8601, short format (local time zone is UTC):\n * const result = formatISO(new Date(2019, 8, 18, 19, 0, 52), { format: 'basic' })\n * //=> '20190918T190052'\n *\n * @example\n * // Represent 18 September 2019 in ISO 8601 format, date only:\n * const result = formatISO(new Date(2019, 8, 18, 19, 0, 52), { representation: 'date' })\n * //=> '2019-09-18'\n *\n * @example\n * // Represent 18 September 2019 in ISO 8601 format, time only (local time zone is UTC):\n * const result = formatISO(new Date(2019, 8, 18, 19, 0, 52), { representation: 'time' })\n * //=> '19:00:52Z'\n */\nexport default function formatISO(date, options) {\n var _options$format, _options$representati;\n requiredArgs(1, arguments);\n var originalDate = toDate(date);\n if (isNaN(originalDate.getTime())) {\n throw new RangeError('Invalid time value');\n }\n var format = String((_options$format = options === null || options === void 0 ? void 0 : options.format) !== null && _options$format !== void 0 ? _options$format : 'extended');\n var representation = String((_options$representati = options === null || options === void 0 ? void 0 : options.representation) !== null && _options$representati !== void 0 ? _options$representati : 'complete');\n if (format !== 'extended' && format !== 'basic') {\n throw new RangeError(\"format must be 'extended' or 'basic'\");\n }\n if (representation !== 'date' && representation !== 'time' && representation !== 'complete') {\n throw new RangeError(\"representation must be 'date', 'time', or 'complete'\");\n }\n var result = '';\n var tzOffset = '';\n var dateDelimiter = format === 'extended' ? '-' : '';\n var timeDelimiter = format === 'extended' ? ':' : '';\n\n // Representation is either 'date' or 'complete'\n if (representation !== 'time') {\n var day = addLeadingZeros(originalDate.getDate(), 2);\n var month = addLeadingZeros(originalDate.getMonth() + 1, 2);\n var year = addLeadingZeros(originalDate.getFullYear(), 4);\n\n // yyyyMMdd or yyyy-MM-dd.\n result = \"\".concat(year).concat(dateDelimiter).concat(month).concat(dateDelimiter).concat(day);\n }\n\n // Representation is either 'time' or 'complete'\n if (representation !== 'date') {\n // Add the timezone.\n var offset = originalDate.getTimezoneOffset();\n if (offset !== 0) {\n var absoluteOffset = Math.abs(offset);\n var hourOffset = addLeadingZeros(Math.floor(absoluteOffset / 60), 2);\n var minuteOffset = addLeadingZeros(absoluteOffset % 60, 2);\n // If less than 0, the sign is +, because it is ahead of time.\n var sign = offset < 0 ? '+' : '-';\n tzOffset = \"\".concat(sign).concat(hourOffset, \":\").concat(minuteOffset);\n } else {\n tzOffset = 'Z';\n }\n var hour = addLeadingZeros(originalDate.getHours(), 2);\n var minute = addLeadingZeros(originalDate.getMinutes(), 2);\n var second = addLeadingZeros(originalDate.getSeconds(), 2);\n\n // If there's also date, separate it with time with 'T'\n var separator = result === '' ? '' : 'T';\n\n // Creates a time string consisting of hour, minute, and second, separated by delimiters, if defined.\n var time = [hour, minute, second].join(timeDelimiter);\n\n // HHmmss or HH:mm:ss.\n result = \"\".concat(result).concat(separator).concat(time).concat(tzOffset);\n }\n return result;\n}","import classnames from 'classnames';\nimport { formatISO } from 'date-fns';\nimport { type ChangeEvent, useId, useRef } from 'react';\nimport { Icon, type IconicNames, type IconicTypes } from '@/atoms/Icons';\n\nimport { useValue } from '@/hooks/useValue.js';\nimport { useInternalStatus } from '@/hooks/useInternalStatus.js';\nimport { FormControl, type FormControlProps } from './FormControl.js';\n\ninterface DateFieldProps extends Omit<FormControlProps<Date | null>, 'max' | 'min'> {\n description?: string;\n /**\n * Open datepicker text\n */\n openDatepicker?: string;\n id?: string;\n icon?: IconicNames;\n iconType?: IconicTypes;\n errorMessage?: string;\n dataTestId?: string;\n /**\n * Minimum Date allowed\n */\n min?: Date | undefined;\n /**\n * Maximum Date allowed\n */\n max?: Date | undefined;\n}\n\nconst formatDate = (value: Date | number | undefined | null): string => {\n if (!value) {\n return '';\n }\n\n return formatISO(new Date(value), { representation: 'date' });\n};\n\nexport const DateField = (props: DateFieldProps) => {\n const internalId = useId();\n\n const {\n id = internalId,\n name = id,\n label,\n description,\n openDatepicker,\n validationStatus = 'default',\n icon = 'CalendarDefault',\n iconType,\n errorMessage,\n disabled = false,\n required = false,\n hideRequiredStar,\n dataTestId = 'DateField',\n value: initialValue,\n min: initialMin,\n max: initialMax,\n onChange,\n ...rest\n } = props;\n\n // NO LOGIC IS IMPLEMENTED YET HERE\n // THIS IS A VISUAL COMPONENT ONLY\n const ref = useRef<HTMLInputElement>(null);\n const internalStatus = useInternalStatus({\n isDisabled: disabled,\n validationStatus,\n });\n\n const { setValue, value } = useValue<string, Date | number | undefined | null>({\n name,\n formatter: formatDate as never,\n initialValue,\n onChange: (name, value) => onChange?.(name, new Date(value)),\n });\n\n const min = formatDate(initialMin);\n const max = formatDate(initialMax);\n\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\n setValue(event.target.value);\n };\n\n const handleClickPicker = () => {\n ref.current?.showPicker();\n };\n\n return (\n <FormControl\n id={id}\n label={label}\n description={description}\n dataName=\"DateField\"\n dataTestId={dataTestId}\n disabled={disabled}\n required={required}\n hideRequiredStar={hideRequiredStar}\n validationStatus={validationStatus}\n errorMessage={errorMessage}\n >\n <div className=\"relative\">\n <input\n {...rest}\n type=\"date\"\n className={classnames(\n 'text-b3 rounded-pill date-field min-h-[50px] w-full border px-20 py-12 ps-[52px] font-normal outline-none',\n {\n 'border-lightGrey focus:border-black active:border-black':\n internalStatus === 'default',\n 'pe-[52px]': internalStatus === 'error' || internalStatus === 'success',\n 'bg-pearl text-grey': disabled,\n 'bg-white text-black': !disabled,\n 'border-red': !disabled && internalStatus === 'error',\n 'border-green': !disabled && internalStatus === 'success',\n },\n )}\n id={id}\n disabled={disabled}\n required={required}\n ref={ref}\n value={value}\n min={min}\n max={max}\n onChange={handleChange}\n />\n <div\n className={classnames(\n 'pointer-events-none absolute inset-0 flex items-center justify-between px-20 py-12',\n {\n 'text-grey': disabled,\n 'text-red': !disabled && internalStatus === 'error',\n 'text-green': !disabled && internalStatus === 'success',\n },\n )}\n >\n <button className=\"pointer-events-auto leading-none\" onClick={handleClickPicker}>\n <Icon name={icon} iconType={iconType} width=\"24px\" />\n <span className=\"sr-only\">\n {openDatepicker}\n {/* REPLACE THAT WITH SOMETHING LIKE \"OPEN DATEPICKER\" SOONER RATHER THAN LATER PLZ */}\n </span>\n </button>\n <span className=\"ms-auto flex gap-x-8\">\n {internalStatus === 'error' && <Icon name=\"CrossDefault\" width=\"24px\" />}\n {internalStatus === 'success' && <Icon name=\"CheckDefault\" width=\"24px\" />}\n </span>\n </div>\n </div>\n </FormControl>\n );\n};\n"],"names":["_typeof","o","requiredArgs","required","args","toDate","argument","argStr","addLeadingZeros","number","targetLength","sign","output","formatISO","date","options","_options$format","_options$representati","originalDate","format","representation","result","tzOffset","dateDelimiter","timeDelimiter","day","month","year","offset","absoluteOffset","hourOffset","minuteOffset","hour","minute","second","separator","time","formatDate","value","DateField","props","internalId","useId","id","name","label","description","openDatepicker","validationStatus","icon","iconType","errorMessage","disabled","hideRequiredStar","dataTestId","initialValue","initialMin","initialMax","onChange","rest","ref","useRef","internalStatus","useInternalStatus","setValue","useValue","min","max","handleChange","event","handleClickPicker","_a","jsx","FormControl","jsxs","classnames","Icon"],"mappings":";;;;;;;;AAAe,SAASA,EAAQC,GAAG;AACjC;AAEA,SAAOD,IAAwB,OAAO,UAArB,cAA2C,OAAO,OAAO,YAA1B,WAAqC,SAAUC,GAAG;AAChG,WAAO,OAAOA;AAAA,EACf,IAAG,SAAUA,GAAG;AACf,WAAOA,KAAmB,OAAO,UAArB,cAA+BA,EAAE,gBA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A,cAAA,GACF;AAAA,cACA,gBAAA2B,EAAC,QAAK,EAAA,WAAU,wBACb,UAAA;AAAA,gBAAAZ,MAAmB,WAAY,gBAAAU,EAAAI,GAAA,EAAK,MAAK,gBAAe,OAAM,QAAO;AAAA,gBACrEd,MAAmB,aAAa,gBAAAU,EAACI,KAAK,MAAK,gBAAe,OAAM,QAAO;AAAA,cAAA,GAC1E;AAAA,YAAA;AAAA,UAAA;AAAA,QACF;AAAA,MAAA,GACF;AAAA,IAAA;AAAA,EAAA;AAGN;","x_google_ignoreList":[0,1,2,3,4]}
@@ -2,15 +2,16 @@ import { jsxs as i, jsx as e } from "react/jsx-runtime";
2
2
  import { c as r } from "../../chunks/index.js";
3
3
  import { useId as D } from "react";
4
4
  /* empty css */
5
- import { Icon as c } from "/builds/clubmed/cm-trident-ui/node_modules/@clubmed/trident-icons/index.js";
5
+ import { Icon as c } from "../../atoms/Icons/Icon.js";
6
+ import "@clubmed/trident-icons";
6
7
  import { useValue as N } from "../../hooks/useValue.js";
7
- function A(m) {
8
+ function T(m) {
8
9
  const d = D(), {
9
- id: u = d,
10
- name: l = u,
11
- className: p,
10
+ id: p = d,
11
+ name: l = p,
12
+ className: u,
12
13
  dataTestId: h,
13
- disabled: n,
14
+ disabled: o,
14
15
  checked: f = !1,
15
16
  value: a,
16
17
  tabIndex: b = 0,
@@ -18,14 +19,14 @@ function A(m) {
18
19
  hasDropdown: x,
19
20
  children: k,
20
21
  ...w
21
- } = m, { value: o, setValue: I } = N({
22
+ } = m, { value: n, setValue: I } = N({
22
23
  name: l,
23
24
  initialValue: f,
24
25
  onChange(v, s) {
25
26
  t == null || t(v, s ? a !== void 0 ? a : s : null);
26
27
  }
27
28
  });
28
- return /* @__PURE__ */ i("label", { className: r(p, "relative"), children: [
29
+ return /* @__PURE__ */ i("label", { className: r(u, "relative"), children: [
29
30
  /* @__PURE__ */ e(
30
31
  "input",
31
32
  {
@@ -35,11 +36,11 @@ function A(m) {
35
36
  type: "checkbox",
36
37
  tabIndex: b,
37
38
  onChange: () => {
38
- !n && I(!o);
39
+ !o && I(!n);
39
40
  },
40
- checked: o,
41
+ checked: n,
41
42
  "data-name": "Filter",
42
- disabled: n,
43
+ disabled: o,
43
44
  value: a
44
45
  }
45
46
  ),
@@ -51,6 +52,6 @@ function A(m) {
51
52
  ] });
52
53
  }
53
54
  export {
54
- A as Filter
55
+ T as Filter
55
56
  };
56
57
  //# sourceMappingURL=Filter.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Filter.js","sources":["../../../lib/molecules/Forms/Filter.tsx"],"sourcesContent":["import classnames from 'classnames';\nimport { type InputHTMLAttributes, useId } from 'react';\nimport './controls.css';\nimport { Icon } from '@/atoms/Icons';\nimport { useValue } from '@/hooks/useValue.js';\n\nexport interface FilterProps<Value = string>\n extends Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange'> {\n /**\n * The data-testid to apply to the button.\n * This is used for testing purposes.\n * */\n dataTestId?: string;\n /**\n * Is it attached to a dropdown?\n */\n hasDropdown?: boolean;\n\n onChange?: (name: string, value: Value | null) => void;\n}\n\nexport function Filter<Value = string>(props: FilterProps<Value>) {\n const internalId = useId();\n\n const {\n id = internalId,\n name = id,\n className,\n dataTestId,\n disabled,\n checked: initialChecked = false,\n value,\n tabIndex = 0,\n onChange,\n hasDropdown,\n children,\n ...rest\n } = props;\n\n const { value: checked, setValue } = useValue<boolean>({\n name,\n initialValue: initialChecked,\n onChange(name, checked) {\n onChange?.(name, checked ? ((value !== undefined ? value : checked) as Value) : null);\n },\n });\n\n return (\n <label className={classnames(className, 'relative')}>\n <input\n {...rest}\n name={name}\n data-testid={dataTestId}\n type=\"checkbox\"\n tabIndex={tabIndex}\n onChange={() => {\n !disabled && setValue(!checked);\n }}\n checked={checked}\n data-name=\"Filter\"\n disabled={disabled}\n value={value}\n />\n <span>\n <span className={classnames('text-b3 font-semibold')}>{children}</span>\n <Icon width={null} name=\"CheckDefault\" color=\"black\" />\n {hasDropdown && (\n <Icon name=\"ArrowDefaultDown\" className=\"ml-8\" width=\"24px\" color=\"black\" />\n )}\n </span>\n </label>\n );\n}\n"],"names":["Filter","props","internalId","useId","id","name","className","dataTestId","disabled","initialChecked","value","tabIndex","onChange","hasDropdown","children","rest","checked","setValue","useValue","classnames","jsx","Icon"],"mappings":";;;;;;AAqBO,SAASA,EAAuBC,GAA2B;AAChE,QAAMC,IAAaC,KAEb;AAAA,IACJ,IAAAC,IAAKF;AAAA,IACL,MAAAG,IAAOD;AAAA,IACP,WAAAE;AAAA,IACA,YAAAC;AAAA,IACA,UAAAC;AAAA,IACA,SAASC,IAAiB;AAAA,IAC1B,OAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,UAAAC;AAAA,IACA,aAAAC;AAAA,IACA,UAAAC;AAAA,IACA,GAAGC;AAAA,EACD,IAAAd,GAEE,EAAE,OAAOe,GAAS,UAAAC,EAAA,IAAaC,EAAkB;AAAA,IACrD,MAAAb;AAAA,IACA,cAAcI;AAAA,IACd,SAASJ,GAAMW,GAAS;AACtB,MAAAJ,KAAA,QAAAA,EAAWP,GAAMW,IAAYN,MAAU,SAAYA,IAAQM,IAAqB;AAAA,IAClF;AAAA,EAAA,CACD;AAED,2BACG,SAAM,EAAA,WAAWG,EAAWb,GAAW,UAAU,GAChD,UAAA;AAAA,IAAA,gBAAAc;AAAA,MAAC;AAAA,MAAA;AAAA,QACE,GAAGL;AAAA,QACJ,MAAAV;AAAA,QACA,eAAaE;AAAA,QACb,MAAK;AAAA,QACL,UAAAI;AAAA,QACA,UAAU,MAAM;AACb,WAAAH,KAAYS,EAAS,CAACD,CAAO;AAAA,QAChC;AAAA,QACA,SAAAA;AAAA,QACA,aAAU;AAAA,QACV,UAAAR;AAAA,QACA,OAAAE;AAAA,MAAA;AAAA,IACF;AAAA,sBACC,QACC,EAAA,UAAA;AAAA,MAAA,gBAAAU,EAAC,QAAK,EAAA,WAAWD,EAAW,uBAAuB,GAAI,UAAAL,GAAS;AAAA,wBAC/DO,GAAK,EAAA,OAAO,MAAM,MAAK,gBAAe,OAAM,SAAQ;AAAA,MACpDR,KACE,gBAAAO,EAAAC,GAAA,EAAK,MAAK,oBAAmB,WAAU,QAAO,OAAM,QAAO,OAAM,QAAQ,CAAA;AAAA,IAAA,GAE9E;AAAA,EACF,EAAA,CAAA;AAEJ;"}
1
+ {"version":3,"file":"Filter.js","sources":["../../../lib/molecules/Forms/Filter.tsx"],"sourcesContent":["import classnames from 'classnames';\nimport { type InputHTMLAttributes, useId } from 'react';\nimport './controls.css';\nimport { Icon } from '@/atoms/Icons';\nimport { useValue } from '@/hooks/useValue.js';\n\nexport interface FilterProps<Value = string>\n extends Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange'> {\n /**\n * The data-testid to apply to the button.\n * This is used for testing purposes.\n * */\n dataTestId?: string;\n /**\n * Is it attached to a dropdown?\n */\n hasDropdown?: boolean;\n\n onChange?: (name: string, value: Value | null) => void;\n}\n\nexport function Filter<Value = string>(props: FilterProps<Value>) {\n const internalId = useId();\n\n const {\n id = internalId,\n name = id,\n className,\n dataTestId,\n disabled,\n checked: initialChecked = false,\n value,\n tabIndex = 0,\n onChange,\n hasDropdown,\n children,\n ...rest\n } = props;\n\n const { value: checked, setValue } = useValue<boolean>({\n name,\n initialValue: initialChecked,\n onChange(name, checked) {\n onChange?.(name, checked ? ((value !== undefined ? value : checked) as Value) : null);\n },\n });\n\n return (\n <label className={classnames(className, 'relative')}>\n <input\n {...rest}\n name={name}\n data-testid={dataTestId}\n type=\"checkbox\"\n tabIndex={tabIndex}\n onChange={() => {\n !disabled && setValue(!checked);\n }}\n checked={checked}\n data-name=\"Filter\"\n disabled={disabled}\n value={value}\n />\n <span>\n <span className={classnames('text-b3 font-semibold')}>{children}</span>\n <Icon width={null} name=\"CheckDefault\" color=\"black\" />\n {hasDropdown && (\n <Icon name=\"ArrowDefaultDown\" className=\"ml-8\" width=\"24px\" color=\"black\" />\n )}\n </span>\n </label>\n );\n}\n"],"names":["Filter","props","internalId","useId","id","name","className","dataTestId","disabled","initialChecked","value","tabIndex","onChange","hasDropdown","children","rest","checked","setValue","useValue","classnames","jsx","Icon"],"mappings":";;;;;;;AAqBO,SAASA,EAAuBC,GAA2B;AAChE,QAAMC,IAAaC,KAEb;AAAA,IACJ,IAAAC,IAAKF;AAAA,IACL,MAAAG,IAAOD;AAAA,IACP,WAAAE;AAAA,IACA,YAAAC;AAAA,IACA,UAAAC;AAAA,IACA,SAASC,IAAiB;AAAA,IAC1B,OAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,UAAAC;AAAA,IACA,aAAAC;AAAA,IACA,UAAAC;AAAA,IACA,GAAGC;AAAA,EACD,IAAAd,GAEE,EAAE,OAAOe,GAAS,UAAAC,EAAA,IAAaC,EAAkB;AAAA,IACrD,MAAAb;AAAA,IACA,cAAcI;AAAA,IACd,SAASJ,GAAMW,GAAS;AACtB,MAAAJ,KAAA,QAAAA,EAAWP,GAAMW,IAAYN,MAAU,SAAYA,IAAQM,IAAqB;AAAA,IAClF;AAAA,EAAA,CACD;AAED,2BACG,SAAM,EAAA,WAAWG,EAAWb,GAAW,UAAU,GAChD,UAAA;AAAA,IAAA,gBAAAc;AAAA,MAAC;AAAA,MAAA;AAAA,QACE,GAAGL;AAAA,QACJ,MAAAV;AAAA,QACA,eAAaE;AAAA,QACb,MAAK;AAAA,QACL,UAAAI;AAAA,QACA,UAAU,MAAM;AACb,WAAAH,KAAYS,EAAS,CAACD,CAAO;AAAA,QAChC;AAAA,QACA,SAAAA;AAAA,QACA,aAAU;AAAA,QACV,UAAAR;AAAA,QACA,OAAAE;AAAA,MAAA;AAAA,IACF;AAAA,sBACC,QACC,EAAA,UAAA;AAAA,MAAA,gBAAAU,EAAC,QAAK,EAAA,WAAWD,EAAW,uBAAuB,GAAI,UAAAL,GAAS;AAAA,wBAC/DO,GAAK,EAAA,OAAO,MAAM,MAAK,gBAAe,OAAM,SAAQ;AAAA,MACpDR,KACE,gBAAAO,EAAAC,GAAA,EAAK,MAAK,oBAAmB,WAAU,QAAO,OAAM,QAAO,OAAM,QAAQ,CAAA;AAAA,IAAA,GAE9E;AAAA,EACF,EAAA,CAAA;AAEJ;"}
@@ -1,33 +1,34 @@
1
1
  import { jsxs as s, jsx as e } from "react/jsx-runtime";
2
2
  import { useInternalStatus as h } from "../../hooks/useInternalStatus.js";
3
3
  import { FormLabel as S } from "./FormLabel.js";
4
- import { Icon as b } from "/builds/clubmed/cm-trident-ui/node_modules/@clubmed/trident-icons/index.js";
4
+ import { Icon as b } from "../../atoms/Icons/Icon.js";
5
+ import "@clubmed/trident-icons";
5
6
  import { c as g } from "../../chunks/index.js";
6
- const v = ({
7
+ const w = ({
7
8
  id: t,
8
9
  label: r,
9
10
  description: o,
10
- disabled: n,
11
- required: m,
12
- className: l,
13
- validationStatus: i = "default",
14
- children: c,
11
+ disabled: m,
12
+ required: n,
13
+ className: i,
14
+ validationStatus: l = "default",
15
+ children: p,
15
16
  errorMessage: a,
16
- dataTestId: p,
17
+ dataTestId: c,
17
18
  dataName: d,
18
19
  hideRequiredStar: x,
19
20
  layout: f
20
21
  }) => {
21
22
  const u = h({
22
- isDisabled: !!n,
23
- validationStatus: i
23
+ isDisabled: !!m,
24
+ validationStatus: l
24
25
  }) === "error" && a;
25
26
  return /* @__PURE__ */ s(
26
27
  "div",
27
28
  {
28
- className: g("flex flex-col gap-4", l),
29
+ className: g("flex flex-col gap-4", i),
29
30
  "data-name": d,
30
- "data-testid": p,
31
+ "data-testid": c,
31
32
  children: [
32
33
  r && t && /* @__PURE__ */ e(
33
34
  S,
@@ -35,12 +36,12 @@ const v = ({
35
36
  description: o,
36
37
  id: t,
37
38
  layout: f,
38
- required: m,
39
+ required: n,
39
40
  hideRequiredStar: x,
40
41
  children: r
41
42
  }
42
43
  ),
43
- c,
44
+ p,
44
45
  u && /* @__PURE__ */ s("span", { className: "text-red text-b4 flex items-start gap-x-4 px-20", children: [
45
46
  /* @__PURE__ */ e(b, { name: "Error", width: "20px" }),
46
47
  a
@@ -50,6 +51,6 @@ const v = ({
50
51
  );
51
52
  };
52
53
  export {
53
- v as FormControl
54
+ w as FormControl
54
55
  };
55
56
  //# sourceMappingURL=FormControl.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FormControl.js","sources":["../../../lib/molecules/Forms/FormControl.tsx"],"sourcesContent":["import type { HTMLAttributes, InputHTMLAttributes, ReactNode } from 'react';\nimport { useInternalStatus, type ValidationStatus } from '@/hooks/useInternalStatus';\nimport { FormLabel, type FormLabelProps } from './FormLabel';\nimport { Icon } from '@/atoms/Icons';\nimport classnames from 'classnames';\n\nexport type FormControlProps<\n Value = unknown,\n Attributes extends HTMLAttributes<HTMLElement> = InputHTMLAttributes<HTMLInputElement>,\n> = {\n value?: Value;\n label?: ReactNode;\n validationStatus?: ValidationStatus;\n onChange?: (name: string, value: Value) => void;\n dataTestId?: string;\n dataName?: string;\n errorMessage?: string;\n} & Omit<Attributes & Partial<FormLabelProps>, 'onChange' | 'value'>;\n\nexport const FormControl = <Value = string,>({\n id,\n label,\n description,\n disabled,\n required,\n className,\n validationStatus = 'default',\n children,\n errorMessage,\n dataTestId,\n dataName,\n hideRequiredStar,\n layout,\n}: FormControlProps<Value>) => {\n const internalStatus = useInternalStatus({\n isDisabled: !!disabled,\n validationStatus,\n });\n\n const shouldDisplayErrorMessage = internalStatus === 'error' && errorMessage;\n\n return (\n <div\n className={classnames('flex flex-col gap-4', className)}\n data-name={dataName}\n data-testid={dataTestId}\n >\n {label && id && (\n <FormLabel\n description={description}\n id={id}\n layout={layout}\n required={required}\n hideRequiredStar={hideRequiredStar}\n >\n {label}\n </FormLabel>\n )}\n\n {children}\n\n {shouldDisplayErrorMessage && (\n <span className=\"text-red text-b4 flex items-start gap-x-4 px-20\">\n <Icon name=\"Error\" width=\"20px\" />\n {errorMessage}\n </span>\n )}\n </div>\n );\n};\n"],"names":["FormControl","id","label","description","disabled","required","className","validationStatus","children","errorMessage","dataTestId","dataName","hideRequiredStar","layout","shouldDisplayErrorMessage","useInternalStatus","jsxs","classnames","jsx","FormLabel","Icon"],"mappings":";;;;;AAmBO,MAAMA,IAAc,CAAkB;AAAA,EAC3C,IAAAC;AAAA,EACA,OAAAC;AAAA,EACA,aAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,kBAAAC,IAAmB;AAAA,EACnB,UAAAC;AAAA,EACA,cAAAC;AAAA,EACA,YAAAC;AAAA,EACA,UAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,QAAAC;AACF,MAA+B;AAMvB,QAAAC,IALiBC,EAAkB;AAAA,IACvC,YAAY,CAAC,CAACX;AAAA,IACd,kBAAAG;AAAA,EAAA,CACD,MAEoD,WAAWE;AAG9D,SAAA,gBAAAO;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC,EAAW,uBAAuBX,CAAS;AAAA,MACtD,aAAWK;AAAA,MACX,eAAaD;AAAA,MAEZ,UAAA;AAAA,QAAAR,KAASD,KACR,gBAAAiB;AAAA,UAACC;AAAA,UAAA;AAAA,YACC,aAAAhB;AAAA,YACA,IAAAF;AAAA,YACA,QAAAY;AAAA,YACA,UAAAR;AAAA,YACA,kBAAAO;AAAA,YAEC,UAAAV;AAAA,UAAA;AAAA,QACH;AAAA,QAGDM;AAAA,QAEAM,KACC,gBAAAE,EAAC,QAAK,EAAA,WAAU,mDACd,UAAA;AAAA,UAAA,gBAAAE,EAACE,GAAK,EAAA,MAAK,SAAQ,OAAM,QAAO;AAAA,UAC/BX;AAAA,QAAA,GACH;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIR;"}
1
+ {"version":3,"file":"FormControl.js","sources":["../../../lib/molecules/Forms/FormControl.tsx"],"sourcesContent":["import type { HTMLAttributes, InputHTMLAttributes, ReactNode } from 'react';\nimport { useInternalStatus, type ValidationStatus } from '@/hooks/useInternalStatus';\nimport { FormLabel, type FormLabelProps } from './FormLabel';\nimport { Icon } from '@/atoms/Icons';\nimport classnames from 'classnames';\n\nexport type FormControlProps<\n Value = unknown,\n Attributes extends HTMLAttributes<HTMLElement> = InputHTMLAttributes<HTMLInputElement>,\n> = {\n value?: Value;\n label?: ReactNode;\n validationStatus?: ValidationStatus;\n onChange?: (name: string, value: Value) => void;\n dataTestId?: string;\n dataName?: string;\n errorMessage?: string;\n} & Omit<Attributes & Partial<FormLabelProps>, 'onChange' | 'value'>;\n\nexport const FormControl = <Value = string,>({\n id,\n label,\n description,\n disabled,\n required,\n className,\n validationStatus = 'default',\n children,\n errorMessage,\n dataTestId,\n dataName,\n hideRequiredStar,\n layout,\n}: FormControlProps<Value>) => {\n const internalStatus = useInternalStatus({\n isDisabled: !!disabled,\n validationStatus,\n });\n\n const shouldDisplayErrorMessage = internalStatus === 'error' && errorMessage;\n\n return (\n <div\n className={classnames('flex flex-col gap-4', className)}\n data-name={dataName}\n data-testid={dataTestId}\n >\n {label && id && (\n <FormLabel\n description={description}\n id={id}\n layout={layout}\n required={required}\n hideRequiredStar={hideRequiredStar}\n >\n {label}\n </FormLabel>\n )}\n\n {children}\n\n {shouldDisplayErrorMessage && (\n <span className=\"text-red text-b4 flex items-start gap-x-4 px-20\">\n <Icon name=\"Error\" width=\"20px\" />\n {errorMessage}\n </span>\n )}\n </div>\n );\n};\n"],"names":["FormControl","id","label","description","disabled","required","className","validationStatus","children","errorMessage","dataTestId","dataName","hideRequiredStar","layout","shouldDisplayErrorMessage","useInternalStatus","jsxs","classnames","jsx","FormLabel","Icon"],"mappings":";;;;;;AAmBO,MAAMA,IAAc,CAAkB;AAAA,EAC3C,IAAAC;AAAA,EACA,OAAAC;AAAA,EACA,aAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,kBAAAC,IAAmB;AAAA,EACnB,UAAAC;AAAA,EACA,cAAAC;AAAA,EACA,YAAAC;AAAA,EACA,UAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,QAAAC;AACF,MAA+B;AAMvB,QAAAC,IALiBC,EAAkB;AAAA,IACvC,YAAY,CAAC,CAACX;AAAA,IACd,kBAAAG;AAAA,EAAA,CACD,MAEoD,WAAWE;AAG9D,SAAA,gBAAAO;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC,EAAW,uBAAuBX,CAAS;AAAA,MACtD,aAAWK;AAAA,MACX,eAAaD;AAAA,MAEZ,UAAA;AAAA,QAAAR,KAASD,KACR,gBAAAiB;AAAA,UAACC;AAAA,UAAA;AAAA,YACC,aAAAhB;AAAA,YACA,IAAAF;AAAA,YACA,QAAAY;AAAA,YACA,UAAAR;AAAA,YACA,kBAAAO;AAAA,YAEC,UAAAV;AAAA,UAAA;AAAA,QACH;AAAA,QAGDM;AAAA,QAEAM,KACC,gBAAAE,EAAC,QAAK,EAAA,WAAU,mDACd,UAAA;AAAA,UAAA,gBAAAE,EAACE,GAAK,EAAA,MAAK,SAAQ,OAAM,QAAO;AAAA,UAC/BX;AAAA,QAAA,GACH;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIR;"}
@@ -1,12 +1,13 @@
1
- import { jsxs as c, jsx as a } from "react/jsx-runtime";
1
+ import { jsxs as p, jsx as a } from "react/jsx-runtime";
2
2
  import { useInternalStatus as M } from "../../../hooks/useInternalStatus.js";
3
3
  import { c as f } from "../../../chunks/index.js";
4
4
  import { useId as P, useState as T, useEffect as q } from "react";
5
5
  import { useValue as F } from "../../../hooks/useValue.js";
6
6
  import { FormControl as z } from "../FormControl.js";
7
- import { Icon as p } from "/builds/clubmed/cm-trident-ui/node_modules/@clubmed/trident-icons/index.js";
7
+ import { Icon as c } from "../../../atoms/Icons/Icon.js";
8
+ import "@clubmed/trident-icons";
8
9
  import { ValidationMessage as E } from "./ValidationMessage.js";
9
- function O(b) {
10
+ function Q(b) {
10
11
  const x = P(), {
11
12
  id: l = x,
12
13
  name: o = l,
@@ -35,7 +36,7 @@ function O(b) {
35
36
  n(t ? "password" : r);
36
37
  }, [r, t]);
37
38
  const k = () => n(r === "password" ? "text" : "password");
38
- return /* @__PURE__ */ c(
39
+ return /* @__PURE__ */ p(
39
40
  z,
40
41
  {
41
42
  className: y,
@@ -49,7 +50,7 @@ function O(b) {
49
50
  validationStatus: s ? "default" : e,
50
51
  errorMessage: w,
51
52
  children: [
52
- /* @__PURE__ */ c("div", { className: "relative", children: [
53
+ /* @__PURE__ */ p("div", { className: "relative", children: [
53
54
  /* @__PURE__ */ a(
54
55
  "input",
55
56
  {
@@ -81,9 +82,9 @@ function O(b) {
81
82
  className: f(
82
83
  "pointer-events-none absolute inset-0 flex items-center justify-between px-20 py-12"
83
84
  ),
84
- children: /* @__PURE__ */ c("span", { className: "ms-auto flex gap-x-8", children: [
85
- !s && e === "error" && /* @__PURE__ */ a(p, { name: "CrossDefault", color: "red", width: "24px" }),
86
- !s && e === "success" && /* @__PURE__ */ a(p, { name: "CheckDefault", color: "green", width: "24px" }),
85
+ children: /* @__PURE__ */ p("span", { className: "ms-auto flex gap-x-8", children: [
86
+ !s && e === "error" && /* @__PURE__ */ a(c, { name: "CrossDefault", color: "red", width: "24px" }),
87
+ !s && e === "success" && /* @__PURE__ */ a(c, { name: "CheckDefault", color: "green", width: "24px" }),
87
88
  !t && /* @__PURE__ */ a(
88
89
  "button",
89
90
  {
@@ -91,7 +92,7 @@ function O(b) {
91
92
  className: "pointer-events-auto size-24 inline-flex",
92
93
  onClick: k,
93
94
  children: /* @__PURE__ */ a(
94
- p,
95
+ c,
95
96
  {
96
97
  name: r === "password" ? "Invisible" : "Visible",
97
98
  width: "24px",
@@ -110,6 +111,6 @@ function O(b) {
110
111
  );
111
112
  }
112
113
  export {
113
- O as Password
114
+ Q as Password
114
115
  };
115
116
  //# sourceMappingURL=Password.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Password.js","sources":["../../../../lib/molecules/Forms/Password/Password.tsx"],"sourcesContent":["import { useInternalStatus } from '@/hooks/useInternalStatus';\nimport classnames from 'classnames';\n\nimport { type HTMLInputTypeAttribute, useEffect, useId, useState } from 'react';\n\nimport { useValue } from '@/hooks/useValue';\nimport { FormControl, type FormControlProps } from '../FormControl';\nimport { Icon } from '@/atoms/Icons';\nimport { ValidationMessage } from './ValidationMessage';\n\nexport interface PasswordProps<Value> extends FormControlProps<Value> {\n validationMessages?: ValidationMessage[];\n withoutFieldValidation?: boolean;\n}\n\nexport function Password<Value = string>(props: PasswordProps<Value>) {\n const internalId = useId();\n\n const {\n id = internalId,\n name = id,\n label,\n value: initialValue,\n disabled = false,\n required = false,\n hideRequiredStar,\n validationStatus = 'default',\n errorMessage,\n validationMessages = [],\n withoutFieldValidation = false,\n className,\n onChange,\n dataTestId = 'Password',\n ...rest\n } = props;\n\n const internalStatus = useInternalStatus({\n isDisabled: disabled,\n validationStatus,\n });\n\n const { value, setValue } = useValue<Value>({\n name,\n initialValue,\n onChange,\n });\n const [type, setType] = useState<HTMLInputTypeAttribute>('password');\n\n useEffect(() => {\n if (disabled) {\n setType('password');\n } else {\n setType(type);\n }\n }, [type, disabled]);\n\n const toggleType = () => setType(type === 'password' ? 'text' : 'password');\n\n return (\n <FormControl\n className={className}\n id={id}\n label={label}\n dataName=\"Password\"\n dataTestId={dataTestId}\n disabled={disabled}\n required={required}\n hideRequiredStar={hideRequiredStar}\n validationStatus={withoutFieldValidation ? 'default' : validationStatus}\n errorMessage={errorMessage}\n >\n <div className=\"relative\">\n <input\n {...rest}\n id={id}\n name={name}\n type={type}\n value={value as any}\n disabled={disabled}\n required={required}\n onChange={(e) => setValue(e.target.value as Value)}\n className={classnames(\n 'text-b3 rounded-pill w-full border ps-20 py-[11px] font-normal outline-none',\n {\n 'border-lightGrey focus:border-black active:border-black pe-[52px]':\n (withoutFieldValidation || validationStatus === 'default') &&\n internalStatus !== 'disabled',\n 'bg-white text-black': internalStatus !== 'disabled',\n 'bg-pearl text-grey': internalStatus === 'disabled',\n 'pe-[84px]':\n !withoutFieldValidation &&\n (validationStatus === 'error' || validationStatus === 'success'),\n 'border-red': !withoutFieldValidation && validationStatus === 'error',\n 'border-green': !withoutFieldValidation && validationStatus === 'success',\n },\n )}\n aria-label={name}\n />\n\n <div\n className={classnames(\n 'pointer-events-none absolute inset-0 flex items-center justify-between px-20 py-12',\n )}\n >\n <span className=\"ms-auto flex gap-x-8\">\n {!withoutFieldValidation && validationStatus === 'error' && (\n <Icon name=\"CrossDefault\" color=\"red\" width=\"24px\" />\n )}\n\n {!withoutFieldValidation && validationStatus === 'success' && (\n <Icon name=\"CheckDefault\" color=\"green\" width=\"24px\" />\n )}\n\n {!disabled && (\n <button\n type=\"button\"\n className=\"pointer-events-auto size-24 inline-flex\"\n onClick={toggleType}\n >\n <Icon\n name={type === 'password' ? 'Invisible' : 'Visible'}\n width=\"24px\"\n type=\"svg\"\n />\n </button>\n )}\n </span>\n </div>\n </div>\n\n {validationMessages.length > 0 && (\n <div className=\"flex flex-col gap-[10px] mt-8\">\n {validationMessages.map(({ label, status }, index) => (\n <ValidationMessage label={label} status={status} key={index} />\n ))}\n </div>\n )}\n </FormControl>\n );\n}\n"],"names":["Password","props","internalId","useId","id","name","label","initialValue","disabled","required","hideRequiredStar","validationStatus","errorMessage","validationMessages","withoutFieldValidation","className","onChange","dataTestId","rest","internalStatus","useInternalStatus","value","setValue","useValue","type","setType","useState","useEffect","toggleType","jsxs","FormControl","jsx","e","classnames","Icon","status","index","ValidationMessage"],"mappings":";;;;;;;;AAeO,SAASA,EAAyBC,GAA6B;AACpE,QAAMC,IAAaC,KAEb;AAAA,IACJ,IAAAC,IAAKF;AAAA,IACL,MAAAG,IAAOD;AAAA,IACP,OAAAE;AAAA,IACA,OAAOC;AAAA,IACP,UAAAC,IAAW;AAAA,IACX,UAAAC,IAAW;AAAA,IACX,kBAAAC;AAAA,IACA,kBAAAC,IAAmB;AAAA,IACnB,cAAAC;AAAA,IACA,oBAAAC,IAAqB,CAAC;AAAA,IACtB,wBAAAC,IAAyB;AAAA,IACzB,WAAAC;AAAA,IACA,UAAAC;AAAA,IACA,YAAAC,IAAa;AAAA,IACb,GAAG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BH,MAAqB;AAAA,kBAC9D,gBAAgB,CAACG,KAA0BH,MAAqB;AAAA,gBAClE;AAAA,cACF;AAAA,cACA,cAAYN;AAAA,YAAA;AAAA,UACd;AAAA,UAEA,gBAAA0B;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,WAAWE;AAAA,gBACT;AAAA,cACF;AAAA,cAEA,UAAA,gBAAAJ,EAAC,QAAK,EAAA,WAAU,wBACb,UAAA;AAAA,gBAAC,CAAAf,KAA0BH,MAAqB,WAC9C,gBAAAoB,EAAAG,GAAA,EAAK,MAAK,gBAAe,OAAM,OAAM,OAAM,OAAO,CAAA;AAAA,gBAGpD,CAACpB,KAA0BH,MAAqB,aAC/C,gBAAAoB,EAACG,GAAK,EAAA,MAAK,gBAAe,OAAM,SAAQ,OAAM,OAAO,CAAA;AAAA,gBAGtD,CAAC1B,KACA,gBAAAuB;AAAA,kBAAC;AAAA,kBAAA;AAAA,oBACC,MAAK;AAAA,oBACL,WAAU;AAAA,oBACV,SAASH;AAAA,oBAET,UAAA,gBAAAG;AAAA,sBAACG;AAAA,sBAAA;AAAA,wBACC,MAAMV,MAAS,aAAa,cAAc;AAAA,wBAC1C,OAAM;AAAA,wBACN,MAAK;AAAA,sBAAA;AAAA,oBACP;AAAA,kBAAA;AAAA,gBACF;AAAA,cAAA,GAEJ;AAAA,YAAA;AAAA,UACF;AAAA,QAAA,GACF;AAAA,QAECX,EAAmB,SAAS,KAC3B,gBAAAkB,EAAC,SAAI,WAAU,iCACZ,UAAmBlB,EAAA,IAAI,CAAC,EAAE,OAAAP,GAAO,QAAA6B,EAAU,GAAAC,MACzC,gBAAAL,EAAAM,GAAA,EAAkB,OAAO/B,GAAO,QAAA6B,EAAA,GAAqBC,CAAO,CAC9D,EACH,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIR;"}
1
+ {"version":3,"file":"Password.js","sources":["../../../../lib/molecules/Forms/Password/Password.tsx"],"sourcesContent":["import { useInternalStatus } from '@/hooks/useInternalStatus';\nimport classnames from 'classnames';\n\nimport { type HTMLInputTypeAttribute, useEffect, useId, useState } from 'react';\n\nimport { useValue } from '@/hooks/useValue';\nimport { FormControl, type FormControlProps } from '../FormControl';\nimport { Icon } from '@/atoms/Icons';\nimport { ValidationMessage } from './ValidationMessage';\n\nexport interface PasswordProps<Value> extends FormControlProps<Value> {\n validationMessages?: ValidationMessage[];\n withoutFieldValidation?: boolean;\n}\n\nexport function Password<Value = string>(props: PasswordProps<Value>) {\n const internalId = useId();\n\n const {\n id = internalId,\n name = id,\n label,\n value: initialValue,\n disabled = false,\n required = false,\n hideRequiredStar,\n validationStatus = 'default',\n errorMessage,\n validationMessages = [],\n withoutFieldValidation = false,\n className,\n onChange,\n dataTestId = 'Password',\n ...rest\n } = props;\n\n const internalStatus = useInternalStatus({\n isDisabled: disabled,\n validationStatus,\n });\n\n const { value, setValue } = useValue<Value>({\n name,\n initialValue,\n onChange,\n });\n const [type, setType] = useState<HTMLInputTypeAttribute>('password');\n\n useEffect(() => {\n if (disabled) {\n setType('password');\n } else {\n setType(type);\n }\n }, [type, disabled]);\n\n const toggleType = () => setType(type === 'password' ? 'text' : 'password');\n\n return (\n <FormControl\n className={className}\n id={id}\n label={label}\n dataName=\"Password\"\n dataTestId={dataTestId}\n disabled={disabled}\n required={required}\n hideRequiredStar={hideRequiredStar}\n validationStatus={withoutFieldValidation ? 'default' : validationStatus}\n errorMessage={errorMessage}\n >\n <div className=\"relative\">\n <input\n {...rest}\n id={id}\n name={name}\n type={type}\n value={value as any}\n disabled={disabled}\n required={required}\n onChange={(e) => setValue(e.target.value as Value)}\n className={classnames(\n 'text-b3 rounded-pill w-full border ps-20 py-[11px] font-normal outline-none',\n {\n 'border-lightGrey focus:border-black active:border-black pe-[52px]':\n (withoutFieldValidation || validationStatus === 'default') &&\n internalStatus !== 'disabled',\n 'bg-white text-black': internalStatus !== 'disabled',\n 'bg-pearl text-grey': internalStatus === 'disabled',\n 'pe-[84px]':\n !withoutFieldValidation &&\n (validationStatus === 'error' || validationStatus === 'success'),\n 'border-red': !withoutFieldValidation && validationStatus === 'error',\n 'border-green': !withoutFieldValidation && validationStatus === 'success',\n },\n )}\n aria-label={name}\n />\n\n <div\n className={classnames(\n 'pointer-events-none absolute inset-0 flex items-center justify-between px-20 py-12',\n )}\n >\n <span className=\"ms-auto flex gap-x-8\">\n {!withoutFieldValidation && validationStatus === 'error' && (\n <Icon name=\"CrossDefault\" color=\"red\" width=\"24px\" />\n )}\n\n {!withoutFieldValidation && validationStatus === 'success' && (\n <Icon name=\"CheckDefault\" color=\"green\" width=\"24px\" />\n )}\n\n {!disabled && (\n <button\n type=\"button\"\n className=\"pointer-events-auto size-24 inline-flex\"\n onClick={toggleType}\n >\n <Icon\n name={type === 'password' ? 'Invisible' : 'Visible'}\n width=\"24px\"\n type=\"svg\"\n />\n </button>\n )}\n </span>\n </div>\n </div>\n\n {validationMessages.length > 0 && (\n <div className=\"flex flex-col gap-[10px] mt-8\">\n {validationMessages.map(({ label, status }, index) => (\n <ValidationMessage label={label} status={status} key={index} />\n ))}\n </div>\n )}\n </FormControl>\n );\n}\n"],"names":["Password","props","internalId","useId","id","name","label","initialValue","disabled","required","hideRequiredStar","validationStatus","errorMessage","validationMessages","withoutFieldValidation","className","onChange","dataTestId","rest","internalStatus","useInternalStatus","value","setValue","useValue","type","setType","useState","useEffect","toggleType","jsxs","FormControl","jsx","e","classnames","Icon","status","index","ValidationMessage"],"mappings":";;;;;;;;;AAeO,SAASA,EAAyBC,GAA6B;AACpE,QAAMC,IAAaC,KAEb;AAAA,IACJ,IAAAC,IAAKF;AAAA,IACL,MAAAG,IAAOD;AAAA,IACP,OAAAE;AAAA,IACA,OAAOC;AAAA,IACP,UAAAC,IAAW;AAAA,IACX,UAAAC,IAAW;AAAA,IACX,kBAAAC;AAAA,IACA,kBAAAC,IAAmB;AAAA,IACnB,cAAAC;AAAA,IACA,oBAAAC,IAAqB,CAAC;AAAA,IACtB,wBAAAC,IAAyB;AAAA,IACz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xs as i, jsx as e } from "react/jsx-runtime";
1
+ import { jsxs as n, jsx as e } from "react/jsx-runtime";
2
2
  import { c as s } from "../../../chunks/index.js";
3
- import { Icon as a } from "/builds/clubmed/cm-trident-ui/node_modules/@clubmed/trident-icons/index.js";
4
- const t = {
3
+ import { Icon as t } from "../../../atoms/Icons/Icon.js";
4
+ import "@clubmed/trident-icons";
5
+ const a = {
5
6
  default: {
6
7
  iconName: "Edit",
7
8
  iconColor: "middleGrey"
@@ -15,14 +16,14 @@ const t = {
15
16
  iconColor: "green"
16
17
  }
17
18
  };
18
- function p({ label: r, status: c }) {
19
- const { iconName: n, iconColor: o } = t[c];
20
- return /* @__PURE__ */ i("div", { className: "flex gap-[6px] px-20 items-center", children: [
21
- /* @__PURE__ */ e(a, { name: n, width: "30px", color: o }),
19
+ function x({ label: r, status: c }) {
20
+ const { iconName: i, iconColor: o } = a[c];
21
+ return /* @__PURE__ */ n("div", { className: "flex gap-[6px] px-20 items-center", children: [
22
+ /* @__PURE__ */ e(t, { name: i, width: "30px", color: o }),
22
23
  /* @__PURE__ */ e("span", { className: s("text-b3", `text-${o}`), children: r })
23
24
  ] });
24
25
  }
25
26
  export {
26
- p as ValidationMessage
27
+ x as ValidationMessage
27
28
  };
28
29
  //# sourceMappingURL=ValidationMessage.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ValidationMessage.js","sources":["../../../../lib/molecules/Forms/Password/ValidationMessage.tsx"],"sourcesContent":["import classnames from 'classnames';\nimport { Icon } from '@/atoms/Icons';\nimport type { ValidationStatus } from '@/hooks/useInternalStatus';\n\nexport interface ValidationMessage {\n label: string;\n status: ValidationStatus;\n}\n\nconst ICON_PROPS = {\n default: {\n iconName: 'Edit',\n iconColor: 'middleGrey',\n },\n error: {\n iconName: 'Error',\n iconColor: 'red',\n },\n success: {\n iconName: 'CheckDefault',\n iconColor: 'green',\n },\n};\n\nexport function ValidationMessage({ label, status }: ValidationMessage) {\n const { iconName, iconColor } = ICON_PROPS[status];\n\n return (\n <div className=\"flex gap-[6px] px-20 items-center\">\n <Icon name={iconName} width=\"30px\" color={iconColor} />\n <span className={classnames('text-b3', `text-${iconColor}`)}>{label}</span>\n </div>\n );\n}\n"],"names":["ICON_PROPS","ValidationMessage","label","status","iconName","iconColor","jsxs","jsx","Icon","classnames"],"mappings":";;;AASA,MAAMA,IAAa;AAAA,EACjB,SAAS;AAAA,IACP,UAAU;AAAA,IACV,WAAW;AAAA,EACb;AAAA,EACA,OAAO;AAAA,IACL,UAAU;AAAA,IACV,WAAW;AAAA,EACb;AAAA,EACA,SAAS;AAAA,IACP,UAAU;AAAA,IACV,WAAW;AAAA,EACb;AACF;AAEO,SAASC,EAAkB,EAAE,OAAAC,GAAO,QAAAC,KAA6B;AACtE,QAAM,EAAE,UAAAC,GAAU,WAAAC,EAAU,IAAIL,EAAWG,CAAM;AAG/C,SAAA,gBAAAG,EAAC,OAAI,EAAA,WAAU,qCACb,UAAA;AAAA,IAAA,gBAAAC,EAACC,KAAK,MAAMJ,GAAU,OAAM,QAAO,OAAOC,GAAW;AAAA,IACrD,gBAAAE,EAAC,UAAK,WAAWE,EAAW,WAAW,QAAQJ,CAAS,EAAE,GAAI,UAAMH,EAAA,CAAA;AAAA,EACtE,EAAA,CAAA;AAEJ;"}
1
+ {"version":3,"file":"ValidationMessage.js","sources":["../../../../lib/molecules/Forms/Password/ValidationMessage.tsx"],"sourcesContent":["import classnames from 'classnames';\nimport { Icon } from '@/atoms/Icons';\nimport type { ValidationStatus } from '@/hooks/useInternalStatus';\n\nexport interface ValidationMessage {\n label: string;\n status: ValidationStatus;\n}\n\nconst ICON_PROPS = {\n default: {\n iconName: 'Edit',\n iconColor: 'middleGrey',\n },\n error: {\n iconName: 'Error',\n iconColor: 'red',\n },\n success: {\n iconName: 'CheckDefault',\n iconColor: 'green',\n },\n};\n\nexport function ValidationMessage({ label, status }: ValidationMessage) {\n const { iconName, iconColor } = ICON_PROPS[status];\n\n return (\n <div className=\"flex gap-[6px] px-20 items-center\">\n <Icon name={iconName} width=\"30px\" color={iconColor} />\n <span className={classnames('text-b3', `text-${iconColor}`)}>{label}</span>\n </div>\n );\n}\n"],"names":["ICON_PROPS","ValidationMessage","label","status","iconName","iconColor","jsxs","jsx","Icon","classnames"],"mappings":";;;;AASA,MAAMA,IAAa;AAAA,EACjB,SAAS;AAAA,IACP,UAAU;AAAA,IACV,WAAW;AAAA,EACb;AAAA,EACA,OAAO;AAAA,IACL,UAAU;AAAA,IACV,WAAW;AAAA,EACb;AAAA,EACA,SAAS;AAAA,IACP,UAAU;AAAA,IACV,WAAW;AAAA,EACb;AACF;AAEO,SAASC,EAAkB,EAAE,OAAAC,GAAO,QAAAC,KAA6B;AACtE,QAAM,EAAE,UAAAC,GAAU,WAAAC,EAAU,IAAIL,EAAWG,CAAM;AAG/C,SAAA,gBAAAG,EAAC,OAAI,EAAA,WAAU,qCACb,UAAA;AAAA,IAAA,gBAAAC,EAACC,KAAK,MAAMJ,GAAU,OAAM,QAAO,OAAOC,GAAW;AAAA,IACrD,gBAAAE,EAAC,UAAK,WAAWE,EAAW,WAAW,QAAQJ,CAAS,EAAE,GAAI,UAAMH,EAAA,CAAA;AAAA,EACtE,EAAA,CAAA;AAEJ;"}
@@ -3,9 +3,10 @@ import { c as l } from "../../chunks/index.js";
3
3
  import { useValue as I } from "../../hooks/useValue.js";
4
4
  import { useInternalStatus as S } from "../../hooks/useInternalStatus.js";
5
5
  import { FormControl as j } from "./FormControl.js";
6
- import { Icon as n } from "/builds/clubmed/cm-trident-ui/node_modules/@clubmed/trident-icons/index.js";
6
+ import { Icon as n } from "../../atoms/Icons/Icon.js";
7
+ import "@clubmed/trident-icons";
7
8
  import { useId as T } from "react";
8
- const R = (p) => {
9
+ const B = (p) => {
9
10
  const u = T(), {
10
11
  id: t = u,
11
12
  name: a = t,
@@ -99,6 +100,6 @@ const R = (p) => {
99
100
  );
100
101
  };
101
102
  export {
102
- R as Select
103
+ B as Select
103
104
  };
104
105
  //# sourceMappingURL=Select.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Select.js","sources":["../../../lib/molecules/Forms/Select.tsx"],"sourcesContent":["import classnames from 'classnames';\nimport { useValue } from '@/hooks/useValue';\nimport { useInternalStatus } from '@/hooks/useInternalStatus';\nimport { FormControl, type FormControlProps } from './FormControl.js';\nimport { Icon, type IconicTypes } from '@/atoms/Icons';\nimport { type SelectHTMLAttributes, useId } from 'react';\n\nexport interface SelectProps<Value>\n extends FormControlProps<Value, SelectHTMLAttributes<HTMLSelectElement>> {\n description?: string;\n iconType?: IconicTypes;\n errorMessage?: string;\n dataTestId?: string;\n}\n\nexport const Select = <Value = string,>(props: SelectProps<Value>) => {\n const internalId = useId();\n\n const {\n id = internalId,\n name = id,\n label,\n value: initialValue,\n description,\n validationStatus = 'default',\n iconType,\n errorMessage,\n disabled = false,\n required = false,\n hideRequiredStar,\n className,\n dataTestId = id,\n onChange,\n children,\n ...rest\n } = props;\n\n const { value, setValue } = useValue<Value>({ name, initialValue, onChange });\n const internalStatus = useInternalStatus({\n isDisabled: disabled,\n validationStatus,\n });\n\n return (\n <FormControl\n id={id}\n className={className}\n label={label}\n description={description}\n dataName=\"TextField\"\n dataTestId={dataTestId}\n disabled={disabled}\n required={required}\n hideRequiredStar={hideRequiredStar}\n validationStatus={validationStatus}\n errorMessage={errorMessage}\n >\n <div\n className={classnames('relative rounded-pill z-0', {\n 'bg-white': internalStatus !== 'disabled',\n 'bg-pearl': internalStatus === 'disabled',\n })}\n >\n <select\n {...rest}\n id={id}\n name={name}\n disabled={disabled}\n required={required}\n value={value as any}\n onChange={(e) => setValue(e.target.value as Value)}\n className={classnames(\n 'text-b3 rounded-pill w-full border px-20 py-12 font-normal outline-none appearance-none bg-transparent',\n {\n 'border-lightGrey focus:border-black active:border-black pe-[52px]':\n internalStatus === 'default',\n 'pe-[84px]': internalStatus === 'error' || internalStatus === 'success',\n 'text-black': internalStatus !== 'disabled',\n 'text-grey': internalStatus === 'disabled',\n 'border-red': internalStatus === 'error',\n 'border-green': internalStatus === 'success',\n },\n )}\n aria-label={name}\n >\n {children}\n </select>\n\n <div\n className={classnames(\n 'pointer-events-none absolute inset-0 flex items-center justify-between px-20 py-12 -z-1',\n {\n 'text-grey': internalStatus === 'disabled',\n 'text-red': internalStatus === 'error',\n 'text-green': internalStatus === 'success',\n },\n )}\n >\n <span className=\"ms-auto flex gap-x-8\">\n {internalStatus === 'error' && (\n <Icon name=\"CrossDefault\" width=\"24px\" type={iconType} />\n )}\n\n {internalStatus === 'success' && (\n <Icon name=\"CheckDefault\" width=\"24px\" type={iconType} />\n )}\n\n <button className=\"pointer-events-auto inline-flex\">\n <Icon name=\"ArrowDefaultDown\" type=\"svg\" width=\"24px\" color=\"black\" />\n </button>\n </span>\n </div>\n </div>\n </FormControl>\n );\n};\n"],"names":["Select","props","internalId","useId","id","name","label","initialValue","description","validationStatus","iconType","errorMessage","disabled","required","hideRequiredStar","className","dataTestId","onChange","children","rest","value","setValue","useValue","internalStatus","useInternalStatus","jsx","FormControl","jsxs","classnames","e","Icon"],"mappings":";;;;;;;AAea,MAAAA,IAAS,CAAkBC,MAA8B;AACpE,QAAMC,IAAaC,KAEb;AAAA,IACJ,IAAAC,IAAKF;AAAA,IACL,MAAAG,IAAOD;AAAA,IACP,OAAAE;AAAA,IACA,OAAOC;AAAA,IACP,aAAAC;AAAA,IACA,kBAAAC,IAAmB;AAAA,IACnB,UAAAC;AAAA,IACA,cAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,UAAAC,IAAW;AAAA,IACX,kBAAAC;AAAA,IACA,WAAAC;AAAA,IACA,YAAAC,IAAaZ;AAAA,IACb,UAAAa;AAAA,IACA,UAAAC;AAAA,IACA,GAAGC;AAAA,EACD,IAAAlB,GAEE,EAAE,OAAAmB,GAAO,UAAAC,MAAaC,EAAgB,EAAE,MAAAjB,GAAM,cAAAE,GAAc,UAAAU,EAAA,CAAU,GACtEM,IAAiBC,EAAkB;AAAA,IACvC,YAAYZ;AAAA,IACZ,k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b,UAAA;AAAA,kBAAmBJ,MAAA,6BACjBO,GAAK,EAAA,MAAK,gBAAe,OAAM,QAAO,MAAMpB,EAAU,CAAA;AAAA,kBAGxDa,MAAmB,aACjB,gBAAAE,EAAAK,GAAA,EAAK,MAAK,gBAAe,OAAM,QAAO,MAAMpB,EAAU,CAAA;AAAA,kBAGxD,gBAAAe,EAAA,UAAA,EAAO,WAAU,mCAChB,4BAACK,GAAK,EAAA,MAAK,oBAAmB,MAAK,OAAM,OAAM,QAAO,OAAM,QAAQ,CAAA,GACtE;AAAA,gBAAA,GACF;AAAA,cAAA;AAAA,YACF;AAAA,UAAA;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"Select.js","sources":["../../../lib/molecules/Forms/Select.tsx"],"sourcesContent":["import classnames from 'classnames';\nimport { useValue } from '@/hooks/useValue';\nimport { useInternalStatus } from '@/hooks/useInternalStatus';\nimport { FormControl, type FormControlProps } from './FormControl.js';\nimport { Icon, type IconicTypes } from '@/atoms/Icons';\nimport { type SelectHTMLAttributes, useId } from 'react';\n\nexport interface SelectProps<Value>\n extends FormControlProps<Value, SelectHTMLAttributes<HTMLSelectElement>> {\n description?: string;\n iconType?: IconicTypes;\n errorMessage?: string;\n dataTestId?: string;\n}\n\nexport const Select = <Value = string,>(props: SelectProps<Value>) => {\n const internalId = useId();\n\n const {\n id = internalId,\n name = id,\n label,\n value: initialValue,\n description,\n validationStatus = 'default',\n iconType,\n errorMessage,\n disabled = false,\n required = false,\n hideRequiredStar,\n className,\n dataTestId = id,\n onChange,\n children,\n ...rest\n } = props;\n\n const { value, setValue } = useValue<Value>({ name, initialValue, onChange });\n const internalStatus = useInternalStatus({\n isDisabled: disabled,\n validationStatus,\n });\n\n return (\n <FormControl\n id={id}\n className={className}\n label={label}\n description={description}\n dataName=\"TextField\"\n dataTestId={dataTestId}\n disabled={disabled}\n required={required}\n hideRequiredStar={hideRequiredStar}\n validationStatus={validationStatus}\n errorMessage={errorMessage}\n >\n <div\n className={classnames('relative rounded-pill z-0', {\n 'bg-white': internalStatus !== 'disabled',\n 'bg-pearl': internalStatus === 'disabled',\n })}\n >\n <select\n {...rest}\n id={id}\n name={name}\n disabled={disabled}\n required={required}\n value={value as any}\n onChange={(e) => setValue(e.target.value as Value)}\n className={classnames(\n 'text-b3 rounded-pill w-full border px-20 py-12 font-normal outline-none appearance-none bg-transparent',\n {\n 'border-lightGrey focus:border-black active:border-black pe-[52px]':\n internalStatus === 'default',\n 'pe-[84px]': internalStatus === 'error' || internalStatus === 'success',\n 'text-black': internalStatus !== 'disabled',\n 'text-grey': internalStatus === 'disabled',\n 'border-red': internalStatus === 'error',\n 'border-green': internalStatus === 'success',\n },\n )}\n aria-label={name}\n >\n {children}\n </select>\n\n <div\n className={classnames(\n 'pointer-events-none absolute inset-0 flex items-center justify-between px-20 py-12 -z-1',\n {\n 'text-grey': internalStatus === 'disabled',\n 'text-red': internalStatus === 'error',\n 'text-green': internalStatus === 'success',\n },\n )}\n >\n <span className=\"ms-auto flex gap-x-8\">\n {internalStatus === 'error' && (\n <Icon name=\"CrossDefault\" width=\"24px\" type={iconType} />\n )}\n\n {internalStatus === 'success' && (\n <Icon name=\"CheckDefault\" width=\"24px\" type={iconType} />\n )}\n\n <button className=\"pointer-events-auto inline-flex\">\n <Icon name=\"ArrowDefaultDown\" type=\"svg\" width=\"24px\" color=\"black\" />\n </button>\n </span>\n </div>\n </div>\n </FormControl>\n );\n};\n"],"names":["Select","props","internalId","useId","id","name","label","initialValue","description","validationStatus","iconType","errorMessage","disabled","required","hideRequiredStar","className","dataTestId","onChange","children","rest","value","setValue","useValue","internalStatus","useInternalStatus","jsx","FormControl","jsxs","classnames","e","Icon"],"mappings":";;;;;;;;AAea,MAAAA,IAAS,CAAkBC,MAA8B;AACpE,QAAMC,IAAaC,KAEb;AAAA,IACJ,IAAAC,IAAKF;AAAA,IACL,MAAAG,IAAOD;AAAA,IACP,OAAAE;AAAA,IACA,OA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mB;AAAA,oBACjC,aAAaA,MAAmB;AAAA,oBAChC,cAAcA,MAAmB;AAAA,oBACjC,gBAAgBA,MAAmB;AAAA,kBACrC;AAAA,gBACF;AAAA,gBACA,cAAYlB;AAAA,gBAEX,UAAAa;AAAA,cAAA;AAAA,YACH;AAAA,YAEA,gBAAAO;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,WAAWG;AAAA,kBACT;AAAA,kBACA;AAAA,oBACE,aAAaL,MAAmB;AAAA,oBAChC,YAAYA,MAAmB;AAAA,oBAC/B,cAAcA,MAAmB;AAAA,kBACnC;AAAA,gBACF;AAAA,gBAEA,UAAA,gBAAAI,EAAC,QAAK,EAAA,WAAU,wBACb,UAAA;AAAA,kBAAmBJ,MAAA,6BACjBO,GAAK,EAAA,MAAK,gBAAe,OAAM,QAAO,MAAMpB,EAAU,CAAA;AAAA,kBAGxDa,MAAmB,aACjB,gBAAAE,EAAAK,GAAA,EAAK,MAAK,gBAAe,OAAM,QAAO,MAAMpB,EAAU,CAAA;AAAA,kBAGxD,gBAAAe,EAAA,UAAA,EAAO,WAAU,mCAChB,4BAACK,GAAK,EAAA,MAAK,oBAAmB,MAAK,OAAM,OAAM,QAAO,OAAM,QAAQ,CAAA,GACtE;AAAA,gBAAA,GACF;AAAA,cAAA;AAAA,YACF;AAAA,UAAA;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAAA,EAAA;AAGN;"}
@@ -1,11 +1,12 @@
1
1
  import { jsx as r, jsxs as o } from "react/jsx-runtime";
2
- import { c as u } from "../../chunks/index.js";
2
+ import { c as m } from "../../chunks/index.js";
3
3
  import { useValue as F } from "../../hooks/useValue.js";
4
4
  import { useInternalStatus as S } from "../../hooks/useInternalStatus.js";
5
5
  import { FormControl as j } from "./FormControl.js";
6
- import { Icon as i } from "/builds/clubmed/cm-trident-ui/node_modules/@clubmed/trident-icons/index.js";
6
+ import { Icon as i } from "../../atoms/Icons/Icon.js";
7
+ import "@clubmed/trident-icons";
7
8
  import { useId as D } from "react";
8
- const B = (m) => {
9
+ const E = (u) => {
9
10
  const p = D(), {
10
11
  id: t = p,
11
12
  name: a = t,
@@ -24,7 +25,7 @@ const B = (m) => {
24
25
  onChange: w,
25
26
  formatter: N,
26
27
  ...C
27
- } = m, { value: I, setValue: T } = F({ name: a, initialValue: b, onChange: w, formatter: N }), e = S({
28
+ } = u, { value: I, setValue: T } = F({ name: a, initialValue: b, onChange: w, formatter: N }), e = S({
28
29
  isDisabled: l,
29
30
  validationStatus: n
30
31
  });
@@ -53,7 +54,7 @@ const B = (m) => {
53
54
  required: c,
54
55
  value: I,
55
56
  onChange: (k) => T(k.target.value),
56
- className: u(
57
+ className: m(
57
58
  "text-b3 rounded-pill w-full border px-20 py-12 font-normal outline-none",
58
59
  {
59
60
  "border-lightGrey focus:border-black active:border-black": e === "default",
@@ -71,7 +72,7 @@ const B = (m) => {
71
72
  /* @__PURE__ */ o(
72
73
  "div",
73
74
  {
74
- className: u(
75
+ className: m(
75
76
  "pointer-events-none absolute inset-0 flex items-center justify-between px-20 py-12",
76
77
  {
77
78
  "text-grey": e === "disabled",
@@ -93,6 +94,6 @@ const B = (m) => {
93
94
  );
94
95
  };
95
96
  export {
96
- B as TextField
97
+ E as TextField
97
98
  };
98
99
  //# sourceMappingURL=TextField.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TextField.js","sources":["../../../lib/molecules/Forms/TextField.tsx"],"sourcesContent":["import classnames from 'classnames';\nimport { useValue, type UseValueProps } from '@/hooks/useValue';\nimport { useInternalStatus } from '@/hooks/useInternalStatus';\nimport { FormControl, type FormControlProps } from './FormControl.js';\nimport { Icon, type IconicNames, type IconicTypes } from '@/atoms/Icons';\nimport { useId } from 'react';\n\nexport interface TextFieldProps<Value> extends FormControlProps<Value> {\n description?: string;\n icon?: IconicNames;\n iconType?: IconicTypes;\n errorMessage?: string;\n dataTestId?: string;\n formatter?: UseValueProps<Value>['formatter'];\n}\n\nexport const TextField = <Value = string,>(props: TextFieldProps<Value>) => {\n const internalId = useId();\n\n const {\n id = internalId,\n name = id,\n label,\n value: initialValue,\n description,\n validationStatus = 'default',\n icon,\n iconType,\n errorMessage,\n disabled = false,\n required = false,\n hideRequiredStar,\n className,\n dataTestId = 'TextField',\n onChange,\n formatter,\n ...rest\n } = props;\n\n const { value, setValue } = useValue<Value>({ name, initialValue, onChange, formatter });\n const internalStatus = useInternalStatus({\n isDisabled: disabled,\n validationStatus,\n });\n\n return (\n <FormControl\n id={id}\n label={label}\n className={className}\n description={description}\n dataName=\"TextField\"\n dataTestId={dataTestId}\n disabled={disabled}\n required={required}\n hideRequiredStar={hideRequiredStar}\n validationStatus={validationStatus}\n errorMessage={errorMessage}\n >\n <div className=\"relative\">\n <input\n {...rest}\n id={id}\n name={name}\n disabled={disabled}\n required={required}\n value={value as any}\n onChange={(e) => setValue(e.target.value as Value)}\n className={classnames(\n 'text-b3 rounded-pill w-full border px-20 py-12 font-normal outline-none',\n {\n 'border-lightGrey focus:border-black active:border-black':\n internalStatus === 'default',\n 'ps-[52px]': icon,\n 'pe-[52px]': internalStatus === 'error' || internalStatus === 'success',\n 'bg-white text-black': internalStatus !== 'disabled',\n 'bg-pearl text-grey': internalStatus === 'disabled',\n 'border-red': internalStatus === 'error',\n 'border-green': internalStatus === 'success',\n },\n )}\n aria-label={name}\n />\n\n <div\n className={classnames(\n 'pointer-events-none absolute inset-0 flex items-center justify-between px-20 py-12',\n {\n 'text-grey': internalStatus === 'disabled',\n 'text-red': internalStatus === 'error',\n 'text-green': internalStatus === 'success',\n },\n )}\n >\n {icon && <Icon name={icon} width=\"24px\" />}\n\n <span className=\"ms-auto flex gap-x-8\">\n {internalStatus === 'error' && (\n <Icon name=\"CrossDefault\" width=\"24px\" type={iconType} />\n )}\n\n {internalStatus === 'success' && (\n <Icon name=\"CheckDefault\" width=\"24px\" type={iconType} />\n )}\n </span>\n </div>\n </div>\n </FormControl>\n );\n};\n"],"names":["TextField","props","internalId","useId","id","name","label","initialValue","description","validationStatus","icon","iconType","errorMessage","disabled","required","hideRequiredStar","className","dataTestId","onChange","formatter","rest","value","setValue","useValue","internalStatus","useInternalStatus","jsx","FormControl","jsxs","e","classnames","Icon"],"mappings":";;;;;;;AAgBa,MAAAA,IAAY,CAAkBC,MAAiC;AAC1E,QAAMC,IAAaC,KAEb;AAAA,IACJ,IAAAC,IAAKF;AAAA,IACL,MAAAG,IAAOD;AAAA,IACP,OAAAE;AAAA,IACA,OAAOC;AAAA,IACP,aAAAC;AAAA,IACA,kBAAAC,IAAmB;AAAA,IACnB,MAAAC;AAAA,IACA,UAAAC;AAAA,IACA,cAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,UAAAC,IAAW;AAAA,IACX,kBAAAC;AAAA,IACA,WAAAC;AAAA,IACA,YAAAC,IAAa;AAAA,IACb,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,GAAGC;AAAA,EACD,IAAAnB,GAEE,EAAE,OAAAoB,GAAO,UAAAC,EAAA,IAAaC,EAAgB,EAAE,MAAAlB,GAAM,cAAAE,GAAc,UAAAW,GAAU,WAAAC,EAAA,CAAW,GACjFK,IAAiBC,EAAkB;AAAA,IACvC,YAAYZ;AAAA,IACZ,kBAAAJ;AAAA,EAAA,CACD;AAGC,SAAA,gBAAAiB;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,IAAAvB;AAAA,MACA,OAAAE;AAAA,MACA,WAAAU;AAAA,MACA,aAAAR;AAAA,MACA,UAAS;AAAA,MACT,YAAAS;AAAA,MACA,UAAAJ;AAAA,MACA,UAAAC;AAAA,MACA,kBAAAC;AAAA,MACA,kBAAAN;AAAA,MACA,cAAAG;AAAA,MAEA,UAAA,gBAAAgB,EAAC,OAAI,EAAA,WAAU,YACb,UAAA;AAAA,QAAA,gBAAAF;AAAA,UAAC;AAAA,UAAA;AAAA,YACE,GAAGN;AAAA,YACJ,IAAAhB;AAAA,YACA,MAAAC;AAAA,YACA,UAAAQ;AAAA,YACA,UAAAC;AAAA,YACA,OAAAO;AAAA,YACA,UAAU,CAACQ,MAAMP,EAASO,EAAE,OAAO,KAAc;AAAA,YACjD,WAAWC;AAAA,cACT;AAAA,cACA;AAAA,gBACE,2DACEN,MAAmB;AAAA,gBACrB,aAAad;AAAA,gBACb,aAAac,MAAmB,WAAWA,MAAmB;AAAA,gBAC9D,uBAAuBA,MAAmB;AAAA,gBAC1C,sBAAsBA,MAAmB;AAAA,gBACzC,cAAcA,MAAmB;AAAA,gBACjC,gBAAgBA,MAAmB;AAAA,cACrC;AAAA,YACF;AAAA,YACA,cAAYnB;AAAA,UAAA;AAAA,QACd;AAAA,QAEA,gBAAAuB;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAWE;AAAA,cACT;AAAA,cACA;AAAA,gBACE,aAAaN,MAAmB;AAAA,gBAChC,YAAYA,MAAmB;AAAA,gBAC/B,cAAcA,MAAmB;AAAA,cACnC;AAAA,YACF;AAAA,YAEC,UAAA;AAAA,cAAAd,KAAS,gBAAAgB,EAAAK,GAAA,EAAK,MAAMrB,GAAM,OAAM,QAAO;AAAA,cAExC,gBAAAkB,EAAC,QAAK,EAAA,WAAU,wBACb,UAAA;AAAA,gBAAmBJ,MAAA,6BACjBO,GAAK,EAAA,MAAK,gBAAe,OAAM,QAAO,MAAMpB,EAAU,CAAA;AAAA,gBAGxDa,MAAmB,aACjB,gBAAAE,EAAAK,GAAA,EAAK,MAAK,gBAAe,OAAM,QAAO,MAAMpB,EAAU,CAAA;AAAA,cAAA,GAE3D;AAAA,YAAA;AAAA,UAAA;AAAA,QACF;AAAA,MAAA,GACF;AAAA,IAAA;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"TextField.js","sources":["../../../lib/molecules/Forms/TextField.tsx"],"sourcesContent":["import classnames from 'classnames';\nimport { useValue, type UseValueProps } from '@/hooks/useValue';\nimport { useInternalStatus } from '@/hooks/useInternalStatus';\nimport { FormControl, type FormControlProps } from './FormControl.js';\nimport { Icon, type IconicNames, type IconicTypes } from '@/atoms/Icons';\nimport { useId } from 'react';\n\nexport interface TextFieldProps<Value> extends FormControlProps<Value> {\n description?: string;\n icon?: IconicNames;\n iconType?: IconicTypes;\n errorMessage?: string;\n dataTestId?: string;\n formatter?: UseValueProps<Value>['formatter'];\n}\n\nexport const TextField = <Value = string,>(props: TextFieldProps<Value>) => {\n const internalId = useId();\n\n const {\n id = internalId,\n name = id,\n label,\n value: initialValue,\n description,\n validationStatus = 'default',\n icon,\n iconType,\n errorMessage,\n disabled = false,\n required = false,\n hideRequiredStar,\n className,\n dataTestId = 'TextField',\n onChange,\n formatter,\n ...rest\n } = props;\n\n const { value, setValue } = useValue<Value>({ name, initialValue, onChange, formatter });\n const internalStatus = useInternalStatus({\n isDisabled: disabled,\n validationStatus,\n });\n\n return (\n <FormControl\n id={id}\n label={label}\n className={className}\n description={description}\n dataName=\"TextField\"\n dataTestId={dataTestId}\n disabled={disabled}\n required={required}\n hideRequiredStar={hideRequiredStar}\n validationStatus={validationStatus}\n errorMessage={errorMessage}\n >\n <div className=\"relative\">\n <input\n {...rest}\n id={id}\n name={name}\n disabled={disabled}\n required={required}\n value={value as any}\n onChange={(e) => setValue(e.target.value as Value)}\n className={classnames(\n 'text-b3 rounded-pill w-full border px-20 py-12 font-normal outline-none',\n {\n 'border-lightGrey focus:border-black active:border-black':\n internalStatus === 'default',\n 'ps-[52px]': icon,\n 'pe-[52px]': internalStatus === 'error' || internalStatus === 'success',\n 'bg-white text-black': internalStatus !== 'disabled',\n 'bg-pearl text-grey': internalStatus === 'disabled',\n 'border-red': internalStatus === 'error',\n 'border-green': internalStatus === 'success',\n },\n )}\n aria-label={name}\n />\n\n <div\n className={classnames(\n 'pointer-events-none absolute inset-0 flex items-center justify-between px-20 py-12',\n {\n 'text-grey': internalStatus === 'disabled',\n 'text-red': internalStatus === 'error',\n 'text-green': internalStatus === 'success',\n },\n )}\n >\n {icon && <Icon name={icon} width=\"24px\" />}\n\n <span className=\"ms-auto flex gap-x-8\">\n {internalStatus === 'error' && (\n <Icon name=\"CrossDefault\" width=\"24px\" type={iconType} />\n )}\n\n {internalStatus === 'success' && (\n <Icon name=\"CheckDefault\" width=\"24px\" type={iconType} />\n )}\n </span>\n </div>\n </div>\n </FormControl>\n );\n};\n"],"names":["TextField","props","internalId","useId","id","name","label","initialValue","description","validationStatus","icon","iconType","errorMessage","disabled","required","hideRequiredStar","className","dataTestId","onChange","formatter","rest","value","setValue","useValue","internalStatus","useInternalStatus","jsx","FormControl","jsxs","e","classnames","Icon"],"mappings":";;;;;;;;AAgBa,MAAAA,IAAY,CAAkBC,MAAiC;AAC1E,QAAMC,IAAaC,KAEb;AAAA,IACJ,IAAAC,IAAKF;AAAA,IACL,MAAAG,IAAOD;AAAA,IACP,OAAAE;AAAA,IACA,OAAOC;AAAA,IACP,aAAAC;AAAA,IACA,kBAAAC,IAAmB;AAAA,IACnB,MAAAC;AAAA,IACA,UAAAC;AAAA,IACA,cAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,UAAAC,IAAW;AAAA,IACX,kBAAAC;AAAA,IACA,WAAAC;AAAA,IACA,YAAAC,IAAa;AAAA,IACb,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,GAAGC;AAAA,EACD,IAAAnB,GAEE,EAAE,OAAAoB,GAAO,UAAAC,EAAA,IAAaC,EAAgB,EAAE,MAAAlB,GAAM,cAAAE,GAAc,UAAAW,GAAU,WAAAC,EAAA,CAAW,GACjFK,IAAiBC,EAAkB;AAAA,IACvC,YAAYZ;AAAA,IACZ,kBAAAJ;AAAA,EAAA,CACD;AAGC,SAAA,gBAAAiB;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,IAAAvB;AAAA,MACA,OAAAE;AAAA,MACA,WAAAU;AAAA,MACA,aAAAR;AAAA,MACA,UAAS;AAAA,MACT,YAAAS;AAAA,MACA,UAAAJ;AAAA,MACA,UAAAC;AAAA,MACA,kBAAAC;AAAA,MACA,kBAAAN;AAAA,MACA,cAAAG;AAAA,MAEA,UAAA,gBAAAgB,EAAC,OAA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sxs as t, jsx as c } from "react/jsx-runtime";
1
+ import { jsxs as t, jsx as o } from "react/jsx-runtime";
2
2
  import { c as a } from "../chunks/index.js";
3
- import { Icon as u } from "/builds/clubmed/cm-trident-ui/node_modules/@clubmed/trident-icons/index.js";
4
- const j = ({
3
+ import { Icon as u } from "../atoms/Icons/Icon.js";
4
+ import "@clubmed/trident-icons";
5
+ const C = ({
5
6
  label: n,
6
7
  icon: s,
7
- component: o = "a",
8
+ component: c = "a",
8
9
  iconType: m,
9
10
  underlined: e = !0,
10
11
  className: l,
@@ -13,7 +14,7 @@ const j = ({
13
14
  }) => {
14
15
  const r = n.lastIndexOf(" "), i = r === -1 ? n.length : r, h = n.substring(0, 1), x = n.substring(1, i + 1), g = n.substring(i);
15
16
  return /* @__PURE__ */ t(
16
- p ? "span" : o,
17
+ p ? "span" : c,
17
18
  {
18
19
  className: a(
19
20
  "text-b3 decoration-none link-container cursor-pointer text-inherit",
@@ -22,7 +23,7 @@ const j = ({
22
23
  "data-name": "Link",
23
24
  ...d,
24
25
  children: [
25
- /* @__PURE__ */ c("span", { className: a({ "link-underline": e }), children: h }),
26
+ /* @__PURE__ */ o("span", { className: a({ "link-underline": e }), children: h }),
26
27
  /* @__PURE__ */ t(
27
28
  "span",
28
29
  {
@@ -34,7 +35,7 @@ const j = ({
34
35
  x,
35
36
  /* @__PURE__ */ t("span", { className: "inline-block", children: [
36
37
  g,
37
- s && /* @__PURE__ */ c(
38
+ s && /* @__PURE__ */ o(
38
39
  u,
39
40
  {
40
41
  name: s,
@@ -52,6 +53,6 @@ const j = ({
52
53
  );
53
54
  };
54
55
  export {
55
- j as Link
56
+ C as Link
56
57
  };
57
58
  //# sourceMappingURL=Link.js.map