mado-ui 0.1.2 → 0.2.1
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/css/index.css +161 -88
- package/dist/components/button.d.ts +1 -1
- package/dist/components/form/index.d.ts +2 -1
- package/dist/components/form/input/index.d.ts +4 -4
- package/dist/components/form/submit-button.d.ts +1 -1
- package/dist/components/form/textarea.d.ts +18 -0
- package/dist/components/heading.d.ts +9 -1
- package/dist/components/index.d.ts +2 -2
- package/dist/components/link.d.ts +6 -11
- package/dist/components.esm.js +1329 -0
- package/dist/components.esm.js.map +1 -0
- package/dist/components.js +1343 -0
- package/dist/components.js.map +1 -0
- package/dist/hooks.esm.js +73 -0
- package/dist/hooks.esm.js.map +1 -0
- package/dist/hooks.js +80 -0
- package/dist/hooks.js.map +1 -0
- package/dist/icons.esm.js +416 -0
- package/dist/icons.esm.js.map +1 -0
- package/dist/icons.js +520 -0
- package/dist/icons.js.map +1 -0
- package/dist/index.d.ts +2 -4
- package/dist/index.esm.js +294 -592
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +293 -628
- package/dist/index.js.map +1 -1
- package/dist/types.esm.js +2 -0
- package/dist/types.esm.js.map +1 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/dist/utils.esm.js +751 -0
- package/dist/utils.esm.js.map +1 -0
- package/dist/utils.js +790 -0
- package/dist/utils.js.map +1 -0
- package/package.json +34 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components.js","sources":["../src/utils/custom-tailwind-merge.ts","../src/utils/get-date.ts","../src/utils/helpers.tsx","../src/utils/math.ts","../src/utils/regex.ts","../src/utils/string-manipulation.ts","../src/utils/tw-sort.ts","../src/components/link.tsx","../src/components/button.tsx","../src/hooks/create-fast-context.tsx","../src/hooks/use-form-context.tsx","../src/hooks/use-form-status.tsx","../src/components/form/input/index.tsx","../src/components/form/submit-button.tsx","../src/components/form/textarea.tsx","../src/components/form/index.tsx","../src/components/ghost.tsx","../src/components/heading.tsx","../src/icons/xmark.tsx","../src/components/modal.tsx","../src/components/time.tsx"],"sourcesContent":["import { ConfigExtension, DefaultClassGroupIds, DefaultThemeGroupIds, extendTailwindMerge } from 'tailwind-merge'\n\nexport type AdditionalmadoClassGroupIds =\n\t| 'animation-direction'\n\t| 'animation-fill'\n\t| 'animation-iteration'\n\t| 'animation-state'\n\nconst integerList = Array.from({ length: 100 }, (_, i) => `${i + 1}`)\n\nexport const twMerge = extendTailwindMerge<AdditionalmadoClassGroupIds>({\n\textend: {\n\t\ttheme: {\n\t\t\tcolor: [\n\t\t\t\t{\n\t\t\t\t\tui: [\n\t\t\t\t\t\t'red',\n\t\t\t\t\t\t'orange',\n\t\t\t\t\t\t'yellow',\n\t\t\t\t\t\t'green',\n\t\t\t\t\t\t'sky-blue',\n\t\t\t\t\t\t'blue',\n\t\t\t\t\t\t'violet',\n\t\t\t\t\t\t'magenta',\n\t\t\t\t\t\t'purple',\n\t\t\t\t\t\t'brown',\n\t\t\t\t\t\t'grey',\n\t\t\t\t\t\t'pink',\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t\tclassGroups: {\n\t\t\tanimate: [\n\t\t\t\t{\n\t\t\t\t\tanimate: [\n\t\t\t\t\t\t'bounce',\n\t\t\t\t\t\t'double-spin',\n\t\t\t\t\t\t'drop-in',\n\t\t\t\t\t\t'flip',\n\t\t\t\t\t\t'flip-again',\n\t\t\t\t\t\t'grid-rows',\n\t\t\t\t\t\t'heartbeat',\n\t\t\t\t\t\t'ping',\n\t\t\t\t\t\t'pulse',\n\t\t\t\t\t\t'slide-up',\n\t\t\t\t\t\t'spin',\n\t\t\t\t\t\t'wave',\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t],\n\t\t\t'animation-direction': [\n\t\t\t\t{\n\t\t\t\t\t'animation-direction': ['normal', 'reverse', 'alternate', 'alternate-reverse'],\n\t\t\t\t},\n\t\t\t],\n\t\t\t'animation-fill': [\n\t\t\t\t{\n\t\t\t\t\t'animation-fill': ['none', 'forwards', 'backwards', 'both'],\n\t\t\t\t},\n\t\t\t],\n\t\t\t'animation-iteration': [\n\t\t\t\t{\n\t\t\t\t\t'animation-iteration': [...integerList, 'infinite'],\n\t\t\t\t},\n\t\t\t],\n\t\t\t'animation-state': [\n\t\t\t\t{\n\t\t\t\t\t'animation-state': ['running', 'paused'],\n\t\t\t\t},\n\t\t\t],\n\t\t\t'grid-cols': [\n\t\t\t\t{\n\t\t\t\t\t'grid-cols': ['0fr', '1fr'],\n\t\t\t\t},\n\t\t\t],\n\t\t\t'grid-rows': [\n\t\t\t\t{\n\t\t\t\t\t'grid-rows': ['0fr', '1fr'],\n\t\t\t\t},\n\t\t\t],\n\t\t\ttransition: ['transition-rows'],\n\t\t},\n\t},\n})\n\nexport function extendMadoTailwindMerge<\n\tAdditionalClassGroupIds extends string = AdditionalmadoClassGroupIds,\n\tAdditionalThemeGroupIds extends string = never,\n>(\n\tconfigExtension: ConfigExtension<\n\t\tDefaultClassGroupIds | AdditionalClassGroupIds,\n\t\tDefaultThemeGroupIds | AdditionalThemeGroupIds\n\t>,\n) {\n\tconst extend = configExtension.extend || {}\n\tconst theme = extend.theme || {}\n\tconst color = 'color' in theme ? theme.color : []\n\tconst classGroups = extend.classGroups || {}\n\n\tconst themeRest = { ...theme }\n\tif ('color' in themeRest) delete themeRest.color\n\n\tconst extendRest = { ...extend }\n\tdelete extendRest.theme\n\tdelete extendRest.classGroups\n\n\treturn extendTailwindMerge<AdditionalClassGroupIds, AdditionalThemeGroupIds>({\n\t\textend: {\n\t\t\ttheme: {\n\t\t\t\tcolor: [\n\t\t\t\t\t{\n\t\t\t\t\t\tui: [\n\t\t\t\t\t\t\t'red',\n\t\t\t\t\t\t\t'orange',\n\t\t\t\t\t\t\t'yellow',\n\t\t\t\t\t\t\t'green',\n\t\t\t\t\t\t\t'sky-blue',\n\t\t\t\t\t\t\t'blue',\n\t\t\t\t\t\t\t'violet',\n\t\t\t\t\t\t\t'magenta',\n\t\t\t\t\t\t\t'purple',\n\t\t\t\t\t\t\t'brown',\n\t\t\t\t\t\t\t'grey',\n\t\t\t\t\t\t\t'pink',\n\t\t\t\t\t\t],\n\t\t\t\t\t},\n\t\t\t\t\t...(color as { [key: string]: string[] }[]),\n\t\t\t\t],\n\t\t\t\t...themeRest,\n\t\t\t} as { [key: string]: { [key: string]: string[] }[] } | any,\n\t\t\tclassGroups: {\n\t\t\t\tanimate: [\n\t\t\t\t\t{\n\t\t\t\t\t\tanimate: [\n\t\t\t\t\t\t\t'bounce',\n\t\t\t\t\t\t\t'double-spin',\n\t\t\t\t\t\t\t'drop-in',\n\t\t\t\t\t\t\t'flip',\n\t\t\t\t\t\t\t'flip-again',\n\t\t\t\t\t\t\t'grid-rows',\n\t\t\t\t\t\t\t'heartbeat',\n\t\t\t\t\t\t\t'ping',\n\t\t\t\t\t\t\t'pulse',\n\t\t\t\t\t\t\t'slide-up',\n\t\t\t\t\t\t\t'spin',\n\t\t\t\t\t\t\t'wave',\n\t\t\t\t\t\t],\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\t'animation-direction': [\n\t\t\t\t\t{\n\t\t\t\t\t\t'animation-direction': ['normal', 'reverse', 'alternate', 'alternate-reverse'],\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\t'animation-fill': [\n\t\t\t\t\t{\n\t\t\t\t\t\t'animation-fill': ['none', 'forwards', 'backwards', 'both'],\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\t'animation-iteration': [\n\t\t\t\t\t{\n\t\t\t\t\t\t'animation-iteration': [...integerList, 'infinite'],\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\t'animation-state': [\n\t\t\t\t\t{\n\t\t\t\t\t\t'animation-state': ['running', 'paused'],\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\t'grid-cols': [\n\t\t\t\t\t{\n\t\t\t\t\t\t'grid-cols': ['0fr', '1fr'],\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\t'grid-rows': [\n\t\t\t\t\t{\n\t\t\t\t\t\t'grid-rows': ['0fr', '1fr'],\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\ttransition: ['transition-rows'],\n\t\t\t\t...classGroups,\n\t\t\t} as { [key: string]: { [key: string]: string[] }[] } | any,\n\t\t\t...extendRest,\n\t\t},\n\t\t...configExtension,\n\t})\n}\n","export type MonthName =\n\t| 'January'\n\t| 'February'\n\t| 'March'\n\t| 'April'\n\t| 'May'\n\t| 'June'\n\t| 'July'\n\t| 'August'\n\t| 'September'\n\t| 'October'\n\t| 'November'\n\t| 'December'\n\nexport type WeekdayName = 'Sunday' | 'Monday' | 'Tuesday' | 'Wednesday' | 'Thursday' | 'Friday' | 'Saturday'\n\n/** The current date as a Date object */\nconst d = new Date()\n\n/** The current minute of the current hour */\nconst minutes = d.getMinutes()\n\n/** The current year */\nconst year = d.getFullYear()\n\n/** An array of the names of month in order */\nexport const monthNamesList: MonthName[] = [\n\t'January',\n\t'February',\n\t'March',\n\t'April',\n\t'May',\n\t'June',\n\t'July',\n\t'August',\n\t'September',\n\t'October',\n\t'November',\n\t'December',\n]\n\n/** An array of the names of the days of the week in order */\nexport const weekdayNamesList: WeekdayName[] = [\n\t'Sunday',\n\t'Monday',\n\t'Tuesday',\n\t'Wednesday',\n\t'Thursday',\n\t'Friday',\n\t'Saturday',\n]\n\n/** The name of the current month */\nexport const currentMonthName = getMonthName()\n\n/** The name of the current day of the week */\nexport const currentWeekdayName = getWeekdayName()\n\n/**\n * ### Days In Month\n * - Returns the number of days in the specified month.\n * @param {Date} date A Date object representing the month to get the number of days for. (Preset to the current date)\n * @returns {number} The number of days in the specified month.\n */\nexport function daysInMonth(date: Date = d): number {\n\tconst selectedYear = date.getFullYear(),\n\t\tselectedMonth = date.getMonth() + 1\n\treturn new Date(selectedYear, selectedMonth, 0).getDate()\n}\n\n/**\n * ### First of Month\n * - Returns the first day of the specified month.\n * @param {Date} date A Date object representing the month to get the first day for. (Preset to current date)\n * @returns {Date} A Date object of the given month, with the first day.\n */\nexport function firstOfMonth(date: Date = d): Date {\n\t// Return a new Date object with the first of the month selected\n\treturn new Date(date.getFullYear(), date.getMonth(), 1)\n}\n\n/**\n * ### Get Date\n * - Returns the date with two digits\n * @param {number|Date} date The date to get date\n * @returns {string} The date with two digits\n */\nexport function getDate(date: number | Date = d): string {\n\tif (typeof date !== 'number') date = date.getDate()\n\tlet formattedDate = date.toString()\n\tif (formattedDate.length === 1) formattedDate = `0${formattedDate}`\n\treturn formattedDate\n}\n\n/**\n * ### Get Hours\n * - Returns the hours with two digits\n * @param {number|Date} hours The date to get hours\n * @returns {string} The hours with two digits\n */\nexport function getHours(hours: number | Date = d): string {\n\tif (typeof hours !== 'number') hours = hours.getHours()\n\tlet formattedHours = hours.toString()\n\tif (formattedHours.length === 1) formattedHours = `0${formattedHours}`\n\treturn formattedHours\n}\n\n/**\n * ### Get Hours in 12\n * - Returns the hour based on the specified 24 hour value in a 12 hour format\n * @param {number|Date} hour The hour to be converted to 12 hour format\n * @returns {number} The hour in a 12 hour format\n */\nexport function getHoursIn12(hour: number | Date = d): number {\n\tif (typeof hour !== 'number') hour = hour.getHours()\n\tif (hour > 12) return hour - 12\n\treturn hour\n}\n\n/**\n * ### Get Meridian from Hour\n * - Returns either 'pm' or 'am' based on the specified 24 hour value\n * @param {number|Date} hour The hour to get the meridian from\n * @returns {'am'|'pm'} The meridian for the given hour\n */\nexport function getMeridianFromHour(hour: number | Date = d): 'am' | 'pm' {\n\tif (typeof hour !== 'number') hour = hour.getHours()\n\tif (hour >= 12) return 'pm'\n\treturn 'am'\n}\n\n/**\n * ### Get Milliseconds\n * - Returns the milliseconds with two digits\n * @param {number|Date} milliseconds The date to get milliseconds\n * @returns {string} The milliseconds with two digits\n */\nexport function getMilliseconds(milliseconds: number | Date = d): string {\n\tif (typeof milliseconds !== 'number') milliseconds = milliseconds.getMilliseconds()\n\tlet formattedMilliseconds = minutes.toString()\n\tif (formattedMilliseconds.length === 1) formattedMilliseconds = `0${formattedMilliseconds}`\n\treturn formattedMilliseconds\n}\n\n/**\n * ### Get Minutes\n * - Returns the minutes with two digits\n * @param {number|Date} minutes The date to get minutes\n * @returns {string} The minutes with two digits\n */\nexport function getMinutes(minutes: number | Date = d): string {\n\tif (typeof minutes !== 'number') minutes = minutes.getMinutes()\n\tlet formattedMinutes = minutes.toString()\n\tif (formattedMinutes.length === 1) formattedMinutes = `0${formattedMinutes}`\n\treturn formattedMinutes\n}\n\n/**\n * ### Get Month\n * - Returns the month with two digits\n * @param {number|Date} month The date to get month\n * @returns {string} The month with two digits\n */\nexport function getMonth(month: number | Date = d): string {\n\tif (typeof month !== 'number') month = month.getMonth() + 1\n\tlet formattedMonth = month.toString()\n\tif (formattedMonth.length === 1) formattedMonth = `0${formattedMonth}`\n\treturn formattedMonth\n}\n\nexport function getMonthIndexFromName(name: MonthName): number {\n\treturn monthNamesList.findIndex(monthName => monthName === name)\n}\n\n/**\n * ### Get Month Name\n * - Returns the name of the specified month\n * @param {Date} date A Date object representing the month to get the name of the month from. (Preset to the current date)\n * @returns {MonthName} The name of the specified month\n */\nexport function getMonthName(date: number | Date = d): MonthName {\n\tif (typeof date === 'number') return monthNamesList[date]\n\treturn monthNamesList[date.getMonth()]\n}\n\n/**\n * ### Get Next Month\n * - Returns the number of the following month from the specified month\n * @param {Date} date The Date object representing the month to get the following month from (Preset to current date)\n * @returns {number} The indexed month of the following month\n */\nexport function getNextMonth(date: Date = d): number {\n\tconst givenMonth = date.getMonth() // Get the month from date\n\t// Return the indexed month. min 0, max 11\n\treturn givenMonth === 11 ? 0 : givenMonth + 1\n}\n\n/**\n * ### Get Previous Month\n * - Returns the number of the previous month from the specified month\n * @param {Date} date The Date object representing the month to get the previous month from (Preset to current date)\n * @returns {number} The indexed month of the previous month\n */\nexport function getPreviousMonth(date: Date = d): number {\n\tconst givenMonth = date.getMonth() // Get the month from date\n\t// Return the indexed month. min 0, max 11\n\treturn givenMonth === 0 ? 11 : givenMonth - 1\n}\n\n/**\n * ### Get Seconds\n * - Returns the seconds with two digits\n * @param {number|Date} seconds The date to get seconds\n * @returns {string} The seconds with two digits\n */\nexport function getSeconds(seconds: number | Date = d): string {\n\tif (typeof seconds !== 'number') seconds = seconds.getSeconds()\n\tlet formattedSeconds = seconds.toString()\n\tif (formattedSeconds.length === 1) formattedSeconds = `0${formattedSeconds}`\n\treturn formattedSeconds\n}\n\n/**\n * ### Get User Readable Date\n * - Returns a string of the current date in a user-friendly way\n * - Includes `'Yesterday'`, '`Today'`, and `'Tomorrow'`\n * @param date (default: `new Date()`)\n * @returns {'Today'|'Tomorrow'|'Yesterday'|string} `'weekday, month day, year'` | `'Yesterday'` | `'Today'` | `'Tomorrow'`\n */\nexport function getUserReadableDate(date: Date = d): 'Today' | 'Tomorrow' | 'Yesterday' | string {\n\tconst dateTime = date.getTime()\n\n\tconst today = new Date(),\n\t\tisToday = dateTime === today.getTime()\n\n\tif (isToday) return 'Today'\n\n\tconst yesterday = new Date(today.getDate() - 1),\n\t\tisYesterday = dateTime === yesterday.getTime()\n\n\tif (isYesterday) return 'Yesterday'\n\n\tconst tomorrow = new Date(today.getDate() + 1),\n\t\tisTomorrow = dateTime === tomorrow.getTime()\n\n\tif (isTomorrow) return 'Tomorrow'\n\n\tconst thisYear = today.getFullYear(),\n\t\tisSameYear = date.getFullYear() === thisYear\n\n\tconst fullDateString = toFullDateString(date, {\n\t\tweekday: 'code',\n\t\tyear: !isSameYear,\n\t})\n\n\treturn fullDateString\n}\n\n/**\n * ### Get Weekday Name\n * - Returns the weekday name of the specified day\n * @param {number | Date} weekday A Date object or number representing the day to get the weekday name from. (Preset to the current date)\n * @returns {WeekdayName} The name of the specified weekday\n */\nexport function getWeekdayName(weekday: number | Date = d): WeekdayName {\n\tif (typeof weekday === 'number') return weekdayNamesList[weekday]\n\t// Return the name of the day of the week\n\treturn weekdayNamesList[weekday.getDay()]\n}\n\n/**\n * ### Get Years in Range\n * - Returns an array of years in between the specified minimum and maximum years\n * @param {number} minYear The minimum year\n * @param {number} maxYear The maximum year\n * @returns {number[]} Array of years\n */\nexport function getYearsInRange(minYear: number = 0, maxYear: number = year): number[] {\n\tconst yearList = []\n\n\tfor (let selectedYear = minYear; selectedYear <= maxYear; selectedYear++) {\n\t\tyearList.push(selectedYear)\n\t}\n\n\treturn yearList\n}\n\n/** Change how to display the weekday, month name, day of the month, and year. */\ntype ToFullDateStringOptionsProps = Partial<{\n\t/** Inclusion of the day of the month. (default: `true`) */\n\tday: boolean\n\t/** Inclusion of the month name. (default: `true`/`'full'`) */\n\tmonth: boolean | 'full' | 'code'\n\t/** Inclusion of the day of the week. (default: `true`/`'full'`) */\n\tweekday: boolean | 'full' | 'code'\n\t/** Inclusion of the year. (default: `true`) */\n\tyear: boolean | 'full' | 'code'\n}>\n\n/**\n * ### To Full Date String\n * - Returns a formatted string to display the date\n * @param {Date} date (default: `new Date()`)\n * @param {ToFullDateStringOptionsProps} options Change how to display the weekday, month name, day of the month, and year.\n * @returns {string} '`weekday`, `month` `day`, `year`'\n */\nexport function toFullDateString(date: Date = d, options?: ToFullDateStringOptionsProps): string {\n\tlet weekdayName: string = getWeekdayName(date),\n\t\tmonthName: string = getMonthName(date),\n\t\tdayOfMonth: number | string = date.getDate(),\n\t\tyear = date.getFullYear().toString()\n\n\tif (options) {\n\t\tconst includesWeekday = options.weekday !== false,\n\t\t\tincludesDay = options.day !== false,\n\t\t\tincludesMonth = options.month !== false,\n\t\t\tincludesYear = options.year !== false\n\n\t\tif (includesWeekday) {\n\t\t\tif (options.weekday === 'code') weekdayName = weekdayName.slice(0, 3)\n\n\t\t\tif (includesMonth || includesDay || includesYear) weekdayName += ', '\n\t\t} else {\n\t\t\tweekdayName = ''\n\t\t}\n\n\t\tif (includesMonth) {\n\t\t\tif (options.month === 'code') monthName = monthName.slice(0, 3)\n\n\t\t\tif (includesDay) monthName += ' '\n\t\t} else {\n\t\t\tmonthName = ''\n\t\t}\n\n\t\tif (!includesDay) dayOfMonth = ''\n\n\t\tif (includesYear) {\n\t\t\tif (options.year === 'code') year = year.slice(-2)\n\n\t\t\tif (includesMonth || includesDay) year = ', ' + year\n\t\t} else {\n\t\t\tyear = ''\n\t\t}\n\t}\n\n\treturn weekdayName + monthName + dayOfMonth + year\n}\n\n/**\n * ### Get User Readable Date From Timestampz\n * - Returns a string of the current date in a user-friendly way\n * - Includes `'Yesterday'`, '`Today'`, and `'Tomorrow'`\n * @param string\n * @returns {'Today'|'Tomorrow'|'Yesterday'|string} `'weekday, month day, year'` | `'Yesterday'` | `'Today'` | `'Tomorrow'`\n */\nexport function getUserReadableDateFromTimestampz(timestampz: string): 'Today' | 'Tomorrow' | 'Yesterday' | string {\n\tconst [date, time] = timestampz.split('T') || []\n\n\tconst [year, month, day] = date?.split('-').map(string => Number(string)) || []\n\n\tconst timezoneIsAheadOfUTC = time?.includes('+')\n\n\tconst [hms, _timezone] = timezoneIsAheadOfUTC ? time?.split('+') : time?.split('-') || []\n\n\tconst [hours, minutes, seconds] = hms?.split(':').map(string => Number(string)) || []\n\n\t// const [timezoneHours, timezoneMinutes] = timezone?.split(':').map(string => Number(string)) || []\n\n\tconst dateAndTime = new Date(year, month - 1, day, hours, minutes, seconds),\n\t\tuserReadableDateAndTime = getUserReadableDate(dateAndTime)\n\n\treturn userReadableDateAndTime\n}\n","import { Children, Fragment, isValidElement, ReactElement, ReactNode } from 'react'\n\nexport function findComponentByType(children: ReactNode, componentType: any): ReactElement | null {\n\tconst childrenArray = Children.toArray(children)\n\n\tfor (const child of childrenArray) {\n\t\tif (isValidElement(child) && child.type === componentType) return child\n\t}\n\n\tfor (const child of childrenArray) {\n\t\tif (isValidElement(child)) {\n\t\t\tif (child.type === Fragment && (child as ReactElement<any>).props.children) {\n\t\t\t\tconst found = findComponentByType((child as ReactElement<any>).props.children, componentType)\n\t\t\t\tif (found) return found\n\t\t\t} else if ((child as ReactElement<any>).props.children) {\n\t\t\t\tconst found = findComponentByType((child as ReactElement<any>).props.children, componentType)\n\t\t\t\tif (found) return found\n\t\t\t}\n\t\t}\n\t}\n\n\treturn null\n}\n","export function easeOutExpo(time: number, start: number, end: number, duration: number) {\n\treturn time == duration ? start + end : end * (-Math.pow(2, (-10 * time) / duration) + 1) + start\n}\n","export const emailRegex =\n\t/^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/\n\n/**\n * # Is Email\n * Checks whether the specified string is in email format\n */\nexport function isEmail(email: string) {\n\treturn emailRegex.test(email)\n}\n\nexport const telRegex =\n\t/(?:\\+1\\s|1\\s|)?\\d{3}\\.\\d{3}\\.\\d{4}|(?:\\+1\\s|1\\s|)?\\d{3}-\\d{3}-\\d{4}|(?:\\+1\\s|1\\s|)?\\(\\d{3}\\) \\d{3}-\\d{4}|(?:\\+1\\s|1\\s|\\+1|1|)?\\d{10}/\n\n/**\n * # Is Phone Number\n * Checks whether the specified string is in phone number format\n */\nexport function isPhoneNumber(tel: string) {\n\treturn telRegex.test(tel)\n}\n","/**\n * # Format Phone Number\n * Converts any string containing at least 10 numbers to a formatted phone number\n * @param {string} string\n * @returns {string} string formatted (000) 000-0000\n */\nexport function formatPhoneNumber(string: string, countryCode?: string): string {\n\treturn (\n\t\t`${countryCode ? `+${countryCode} ` : ''}` +\n\t\tstring\n\t\t\t.replace(/\\D/g, '')\n\t\t\t.slice(-10)\n\t\t\t.split('')\n\t\t\t.map((char, index) => {\n\t\t\t\tif (index === 0) return `(${char}`\n\t\t\t\tif (index === 2) return `${char}) `\n\t\t\t\tif (index === 5) return `${char}-`\n\t\t\t\treturn char\n\t\t\t})\n\t\t\t.join('')\n\t)\n}\n\n/**\n * # To Lower Case\n * Converts a string to lowercase, and offers easy string replacements for creating snake case, kebab case, or your own.\n * @param str - The string to convert to lowercase.\n * @param options - Configuration options.\n * @param options[0] - The delimiter to split the string. Defaults to space.\n * @param options[1] - The string to join the parts back together. Defaults to space.\n * @returns The lowercase version of the input string, with the replacements, if provided.\n */\nexport function toLowerCase(str: string, [delimiter, joiner]: [string | undefined, string | undefined]) {\n\treturn str.toLowerCase().replaceAll(delimiter || ' ', joiner || ' ')\n}\n","export default function twSort(className: string) {\n\treturn className\n}\n","// * Types\nimport { AnyElementProps, OneOf } from '../types'\nimport { AnchorHTMLAttributes, ElementType, MouseEventHandler, RefObject } from 'react'\n\n// * Utilities\nimport { twMerge, twSort } from '../utils'\nimport { twJoin } from 'tailwind-merge'\n\nexport type AnchorProps = AnchorHTMLAttributes<HTMLAnchorElement> & {\n\tdisabled?: boolean\n\tref?: RefObject<HTMLAnchorElement | null>\n}\n\nexport function Anchor({ className, disabled, href, onClick, ref, target, rel, ...props }: AnchorProps) {\n\tconst isExternal = `${href}`.startsWith('http'),\n\t\thasHash = `${href}`.includes('#')\n\n\tconst handleClick: MouseEventHandler<HTMLAnchorElement> = e => {\n\t\tif (disabled) return e.preventDefault()\n\n\t\tonClick?.(e)\n\n\t\tsetTimeout(() => history.replaceState({}, document.title, location.pathname), 100)\n\t}\n\n\treturn (\n\t\t<a\n\t\t\tref={ref}\n\t\t\t{...props}\n\t\t\taria-disabled={disabled}\n\t\t\tclassName={twMerge(className, disabled && 'pointer-events-none')}\n\t\t\thref={href}\n\t\t\ttarget={target || (isExternal ? '_blank' : '_self')}\n\t\t\tonClick={hasHash ? handleClick : onClick}\n\t\t\trel={\n\t\t\t\trel !== undefined\n\t\t\t\t\t? rel === 'nofollow'\n\t\t\t\t\t\t? `${rel} noreferrer noopener`\n\t\t\t\t\t\t: `${rel} prefetch`\n\t\t\t\t\t: isExternal\n\t\t\t\t\t\t? 'nofollow noreferrer noopener'\n\t\t\t\t\t\t: 'prefetch'\n\t\t\t}\n\t\t/>\n\t)\n}\n\nexport type LinkProps<T extends ElementType = typeof Anchor> = AnyElementProps<\n\tT,\n\tOneOf<\n\t\t[\n\t\t\t{\n\t\t\t\ttype?:\n\t\t\t\t\t| 'center'\n\t\t\t\t\t| 'lift'\n\t\t\t\t\t| 'ltr'\n\t\t\t\t\t| 'multiline'\n\t\t\t\t\t| 'multiline-center'\n\t\t\t\t\t| 'multiline-lift'\n\t\t\t\t\t| 'multiline-ltr'\n\t\t\t\t\t| 'multiline-rtl'\n\t\t\t\t\t| 'multiline-static'\n\t\t\t\t\t| 'normal'\n\t\t\t\t\t| 'rtl'\n\t\t\t\t\t| 'static'\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype?:\n\t\t\t\t\t| 'fill'\n\t\t\t\t\t| 'fill-lift'\n\t\t\t\t\t| 'fill-ltr'\n\t\t\t\t\t| 'fill-rtl'\n\t\t\t\t\t| 'multiline-fill'\n\t\t\t\t\t| 'multiline-fill-center'\n\t\t\t\t\t| 'multiline-fill-ltr'\n\t\t\t\t\t| 'multiline-fill-lift'\n\t\t\t\t\t| 'multiline-fill-rtl'\n\t\t\t\ttheme?:\n\t\t\t\t\t| 'blue'\n\t\t\t\t\t| 'brown'\n\t\t\t\t\t| 'green'\n\t\t\t\t\t| 'grey'\n\t\t\t\t\t| 'sky-blue'\n\t\t\t\t\t| 'magenta'\n\t\t\t\t\t| 'neutral'\n\t\t\t\t\t| 'orange'\n\t\t\t\t\t| 'pink'\n\t\t\t\t\t| 'purple'\n\t\t\t\t\t| 'red'\n\t\t\t\t\t| 'violet'\n\t\t\t\t\t| 'yellow'\n\t\t\t},\n\t\t]\n\t>\n>\n\n// * Styles\nconst baseClasses = twSort(\n\t'isolate inline-block cursor-pointer duration-300 ease-exponential after:absolute after:left-1/2 after:-z-10 after:-translate-x-1/2 after:duration-500 active:scale-95 active:after:opacity-100',\n)\n\nconst lineStaticClasses = twJoin(\n\tbaseClasses,\n\t'whitespace-nowrap after:-bottom-0.5 after:w-[calc(100%+0.15rem)] after:rounded-full after:border-1 after:border-current',\n)\n\nconst lineClasses = twJoin(\n\tlineStaticClasses,\n\t'whitespace-nowrap transition-transform after:transition-transform after:ease-exponential',\n)\n\nconst scaleXClasses = 'after:scale-x-0 pointer-fine:hover:after:scale-x-100 active:after:scale-x-100'\nconst scaleYClasses = 'after:scale-y-0 pointer-fine:hover:after:scale-y-100 active:after:scale-y-100'\n\nconst lineNormalClasses = twJoin([\n\tlineClasses,\n\tscaleYClasses,\n\t'after:origin-bottom after:translate-y-0.5 active:after:translate-y-0 pointer-fine:hover:after:translate-y-0',\n])\n\nconst lineLtrClasses = twJoin([lineClasses, scaleXClasses, 'after:origin-left'])\n\nconst lineRtlClasses = twJoin([lineClasses, scaleXClasses, 'after:origin-right'])\n\nconst lineCenterClasses = twJoin([lineClasses, scaleXClasses])\n\nconst lineLiftClasses = twJoin([\n\tlineClasses,\n\tscaleYClasses,\n\t'after:origin-bottom after:translate-y-1 after:scale-x-75 active:after:translate-y-0 active:after:scale-x-100 pointer-fine:hover:after:translate-y-0 pointer-fine:hover:after:scale-x-100',\n])\n\nconst fillClasses = twJoin(\n\tbaseClasses,\n\t'whitespace-nowrap transition-[transform_color] after:top-1/2 after:h-[calc(100%+0.05rem)] after:w-[calc(100%+0.25rem)] after:-translate-y-1/2 after:rounded after:ease-exponential active:text-zinc-50 pointer-fine:hover:text-zinc-50',\n)\n\n// Define theme-specific fill color transition classes\nconst getFillColorTransitionClasses = (theme: LinkProps['theme'] = 'blue') => {\n\tswitch (theme) {\n\t\tcase 'brown':\n\t\t\treturn twJoin(fillClasses, 'after:bg-ui-brown after:transition-transform contrast-more:after:bg-ui-brown')\n\t\tcase 'green':\n\t\t\treturn twJoin(fillClasses, 'after:bg-ui-green after:transition-transform contrast-more:after:bg-ui-green')\n\t\tcase 'grey':\n\t\t\treturn twJoin(fillClasses, 'after:bg-ui-grey after:transition-transform contrast-more:after:bg-ui-grey')\n\t\tcase 'sky-blue':\n\t\t\treturn twJoin(fillClasses, 'after:bg-ui-sky-blue after:transition-transform contrast-more:after:bg-ui-sky-blue')\n\t\tcase 'magenta':\n\t\t\treturn twJoin(fillClasses, 'after:bg-ui-magenta after:transition-transform contrast-more:after:bg-ui-magenta')\n\t\tcase 'neutral':\n\t\t\treturn twJoin(\n\t\t\t\tfillClasses,\n\t\t\t\t'after:bg-zinc-700 after:transition-transform contrast-more:after:bg-zinc-700 dark:after:bg-zinc-300 dark:contrast-more:after:bg-zinc-300',\n\t\t\t)\n\t\tcase 'orange':\n\t\t\treturn twJoin(fillClasses, 'after:bg-ui-orange after:transition-transform contrast-more:after:bg-ui-orange')\n\t\tcase 'pink':\n\t\t\treturn twJoin(fillClasses, 'after:bg-ui-pink after:transition-transform contrast-more:after:bg-ui-pink')\n\t\tcase 'purple':\n\t\t\treturn twJoin(fillClasses, 'after:bg-ui-purple after:transition-transform contrast-more:after:bg-ui-purple')\n\t\tcase 'red':\n\t\t\treturn twJoin(fillClasses, 'after:bg-ui-red after:transition-transform contrast-more:after:bg-ui-red')\n\t\tcase 'violet':\n\t\t\treturn twJoin(fillClasses, 'after:bg-ui-violet after:transition-transform contrast-more:after:bg-ui-violet')\n\t\tcase 'yellow':\n\t\t\treturn twJoin(fillClasses, 'after:bg-ui-yellow after:transition-transform contrast-more:after:bg-ui-yellow')\n\t\tcase 'blue':\n\t\tdefault:\n\t\t\treturn twJoin(fillClasses, 'after:bg-ui-blue after:transition-transform contrast-more:after:bg-ui-blue')\n\t}\n}\n\n// Define theme-specific fill center classes\nconst getFillCenterClasses = (theme: LinkProps['theme'] = 'blue') => {\n\tswitch (theme) {\n\t\tcase 'brown':\n\t\t\treturn twJoin(\n\t\t\t\tfillClasses,\n\t\t\t\t'after:scale-x-50 after:scale-y-[0.25] after:bg-ui-brown/0 after:transition-[transform_background-color] active:after:scale-x-100 active:after:scale-y-100 active:after:bg-ui-brown pointer-fine:hover:after:scale-x-100 pointer-fine:hover:after:scale-y-100 pointer-fine:hover:after:bg-ui-brown',\n\t\t\t)\n\t\tcase 'green':\n\t\t\treturn twJoin(\n\t\t\t\tfillClasses,\n\t\t\t\t'after:scale-x-50 after:scale-y-[0.25] after:bg-ui-green/0 after:transition-[transform_background-color] active:after:scale-x-100 active:after:scale-y-100 active:after:bg-ui-green pointer-fine:hover:after:scale-x-100 pointer-fine:hover:after:scale-y-100 pointer-fine:hover:after:bg-ui-green',\n\t\t\t)\n\t\tcase 'grey':\n\t\t\treturn twJoin(\n\t\t\t\tfillClasses,\n\t\t\t\t'after:scale-x-50 after:scale-y-[0.25] after:bg-ui-grey/0 after:transition-[transform_background-color] active:after:scale-x-100 active:after:scale-y-100 active:after:bg-ui-grey pointer-fine:hover:after:scale-x-100 pointer-fine:hover:after:scale-y-100 pointer-fine:hover:after:bg-ui-grey',\n\t\t\t)\n\t\tcase 'sky-blue':\n\t\t\treturn twJoin(\n\t\t\t\tfillClasses,\n\t\t\t\t'after:scale-x-50 after:scale-y-[0.25] after:bg-ui-sky-blue/0 after:transition-[transform_background-color] active:after:scale-x-100 active:after:scale-y-100 active:after:bg-ui-sky-blue pointer-fine:hover:after:scale-x-100 pointer-fine:hover:after:scale-y-100 pointer-fine:hover:after:bg-ui-sky-blue',\n\t\t\t)\n\t\tcase 'magenta':\n\t\t\treturn twJoin(\n\t\t\t\tfillClasses,\n\t\t\t\t'after:scale-x-50 after:scale-y-[0.25] after:bg-ui-magenta/0 after:transition-[transform_background-color] active:after:scale-x-100 active:after:scale-y-100 active:after:bg-ui-magenta pointer-fine:hover:after:scale-x-100 pointer-fine:hover:after:scale-y-100 pointer-fine:hover:after:bg-ui-magenta',\n\t\t\t)\n\t\tcase 'neutral':\n\t\t\treturn twJoin(\n\t\t\t\tfillClasses,\n\t\t\t\t'after:scale-x-50 after:scale-y-[0.25] after:bg-zinc-700/0 after:transition-[transform_background-color] active:after:scale-x-100 active:after:scale-y-100 active:after:bg-zinc-700 dark:after:bg-zinc-300/0 dark:active:after:bg-zinc-300 pointer-fine:hover:after:scale-x-100 pointer-fine:hover:after:scale-y-100 pointer-fine:hover:after:bg-zinc-700 dark:pointer-fine:hover:after:bg-zinc-300',\n\t\t\t)\n\t\tcase 'orange':\n\t\t\treturn twJoin(\n\t\t\t\tfillClasses,\n\t\t\t\t'after:scale-x-50 after:scale-y-[0.25] after:bg-ui-orange/0 after:transition-[transform_background-color] active:after:scale-x-100 active:after:scale-y-100 active:after:bg-ui-orange pointer-fine:hover:after:scale-x-100 pointer-fine:hover:after:scale-y-100 pointer-fine:hover:after:bg-ui-orange',\n\t\t\t)\n\t\tcase 'pink':\n\t\t\treturn twJoin(\n\t\t\t\tfillClasses,\n\t\t\t\t'after:scale-x-50 after:scale-y-[0.25] after:bg-ui-pink/0 after:transition-[transform_background-color] active:after:scale-x-100 active:after:scale-y-100 active:after:bg-ui-pink pointer-fine:hover:after:scale-x-100 pointer-fine:hover:after:scale-y-100 pointer-fine:hover:after:bg-ui-pink',\n\t\t\t)\n\t\tcase 'purple':\n\t\t\treturn twJoin(\n\t\t\t\tfillClasses,\n\t\t\t\t'after:scale-x-50 after:scale-y-[0.25] after:bg-ui-purple/0 after:transition-[transform_background-color] active:after:scale-x-100 active:after:scale-y-100 active:after:bg-ui-purple pointer-fine:hover:after:scale-x-100 pointer-fine:hover:after:scale-y-100 pointer-fine:hover:after:bg-ui-purple',\n\t\t\t)\n\t\tcase 'red':\n\t\t\treturn twJoin(\n\t\t\t\tfillClasses,\n\t\t\t\t'after:scale-x-50 after:scale-y-[0.25] after:bg-ui-red/0 after:transition-[transform_background-color] active:after:scale-x-100 active:after:scale-y-100 active:after:bg-ui-red pointer-fine:hover:after:scale-x-100 pointer-fine:hover:after:scale-y-100 pointer-fine:hover:after:bg-ui-red',\n\t\t\t)\n\t\tcase 'violet':\n\t\t\treturn twJoin(\n\t\t\t\tfillClasses,\n\t\t\t\t'after:scale-x-50 after:scale-y-[0.25] after:bg-ui-violet/0 after:transition-[transform_background-color] active:after:scale-x-100 active:after:scale-y-100 active:after:bg-ui-violet pointer-fine:hover:after:scale-x-100 pointer-fine:hover:after:scale-y-100 pointer-fine:hover:after:bg-ui-violet',\n\t\t\t)\n\t\tcase 'yellow':\n\t\t\treturn twJoin(\n\t\t\t\tfillClasses,\n\t\t\t\t'after:scale-x-50 after:scale-y-[0.25] after:bg-ui-yellow/0 after:transition-[transform_background-color] active:after:scale-x-100 active:after:scale-y-100 active:after:bg-ui-yellow pointer-fine:hover:after:scale-x-100 pointer-fine:hover:after:scale-y-100 pointer-fine:hover:after:bg-ui-yellow',\n\t\t\t)\n\t\tcase 'blue':\n\t\tdefault:\n\t\t\treturn twJoin(\n\t\t\t\tfillClasses,\n\t\t\t\t'after:scale-x-50 after:scale-y-[0.25] after:bg-ui-blue/0 after:transition-[transform_background-color] active:after:scale-x-100 active:after:scale-y-100 active:after:bg-ui-blue pointer-fine:hover:after:scale-x-100 pointer-fine:hover:after:scale-y-100 pointer-fine:hover:after:bg-ui-blue',\n\t\t\t)\n\t}\n}\n\nconst multilineBaseClasses = twSort('bg-linear-to-r from-current to-current bg-no-repeat active:scale-95')\n\nconst multilineLineStaticClasses = 'underline'\nconst multilineNormalClasses = twSort('underline-offset-1 active:underline pointer-fine:hover:underline')\n\nconst multilineClasses = twJoin(multilineBaseClasses, 'duration-500 ease-exponential')\n\nconst multilineLineClasses = twJoin(multilineClasses, 'bg-[position:0%_100%] px-px pb-px transition-[background-size]')\n\nconst multilineXClasses = twJoin(\n\tmultilineLineClasses,\n\t'bg-[size:0%_2px] focus-visible:bg-[size:100%_2px] active:bg-[size:100%_2px] pointer-fine:hover:bg-[size:100%_2px]',\n)\n\nconst multilineLineRtlClasses = twJoin([multilineXClasses, 'bg-[position:100%_100%]'])\n\nconst multilineLineCenterClasses = twJoin([multilineXClasses, 'bg-[position:50%_100%]'])\n\nconst multilineLineLiftClasses = twJoin(\n\tmultilineLineClasses,\n\t'bg-[size:auto_0px] focus-visible:bg-[size:auto_2px] active:bg-[size:auto_2px] pointer-fine:hover:bg-[size:auto_2px]',\n)\n\nconst multilineFillBaseClasses = twJoin(\n\tmultilineBaseClasses,\n\t'rounded px-0.5 py-0.75 focus-visible:text-zinc-50 active:text-zinc-50 pointer-fine:hover:text-zinc-50',\n)\n\nconst getMultilineFillColorClasses = (theme: LinkProps['theme'] = 'blue') => {\n\tswitch (theme) {\n\t\tcase 'brown':\n\t\t\treturn twJoin(\n\t\t\t\tmultilineFillBaseClasses,\n\t\t\t\t'from-ui-brown to-ui-brown transition-[background-size_color] contrast-more:from-ui-brown contrast-more:to-ui-brown',\n\t\t\t)\n\t\tcase 'green':\n\t\t\treturn twJoin(\n\t\t\t\tmultilineFillBaseClasses,\n\t\t\t\t'from-ui-green to-ui-green transition-[background-size_color] contrast-more:from-ui-green contrast-more:to-ui-green',\n\t\t\t)\n\t\tcase 'grey':\n\t\t\treturn twJoin(\n\t\t\t\tmultilineFillBaseClasses,\n\t\t\t\t'from-ui-grey to-ui-grey transition-[background-size_color] contrast-more:from-ui-grey contrast-more:to-ui-grey',\n\t\t\t)\n\t\tcase 'sky-blue':\n\t\t\treturn twJoin(\n\t\t\t\tmultilineFillBaseClasses,\n\t\t\t\t'from-ui-sky-blue to-ui-sky-blue transition-[background-size_color] contrast-more:from-ui-sky-blue contrast-more:to-ui-sky-blue',\n\t\t\t)\n\t\tcase 'magenta':\n\t\t\treturn twJoin(\n\t\t\t\tmultilineFillBaseClasses,\n\t\t\t\t'from-ui-magenta to-ui-magenta transition-[background-size_color] contrast-more:from-ui-magenta contrast-more:to-ui-magenta',\n\t\t\t)\n\t\tcase 'neutral':\n\t\t\treturn twJoin(\n\t\t\t\tmultilineFillBaseClasses,\n\t\t\t\t'from-zinc-700 to-zinc-700 transition-[background-size_color] contrast-more:from-zinc-700 contrast-more:to-zinc-700 dark:from-zinc-300 dark:to-zinc-300 dark:contrast-more:from-zinc-300 dark:contrast-more:to-zinc-300',\n\t\t\t)\n\t\tcase 'orange':\n\t\t\treturn twJoin(\n\t\t\t\tmultilineFillBaseClasses,\n\t\t\t\t'from-ui-orange to-ui-orange transition-[background-size_color] contrast-more:from-ui-orange contrast-more:to-ui-orange',\n\t\t\t)\n\t\tcase 'pink':\n\t\t\treturn twJoin(\n\t\t\t\tmultilineFillBaseClasses,\n\t\t\t\t'from-ui-pink to-ui-pink transition-[background-size_color] contrast-more:from-ui-pink contrast-more:to-ui-pink',\n\t\t\t)\n\t\tcase 'purple':\n\t\t\treturn twJoin(\n\t\t\t\tmultilineFillBaseClasses,\n\t\t\t\t'from-ui-purple to-ui-purple transition-[background-size_color] contrast-more:from-ui-purple contrast-more:to-ui-purple',\n\t\t\t)\n\t\tcase 'red':\n\t\t\treturn twJoin(\n\t\t\t\tmultilineFillBaseClasses,\n\t\t\t\t'from-ui-red to-ui-red transition-[background-size_color] contrast-more:from-ui-red contrast-more:to-ui-red',\n\t\t\t)\n\t\tcase 'violet':\n\t\t\treturn twJoin(\n\t\t\t\tmultilineFillBaseClasses,\n\t\t\t\t'from-ui-violet to-ui-violet transition-[background-size_color] contrast-more:from-ui-violet contrast-more:to-ui-violet',\n\t\t\t)\n\t\tcase 'yellow':\n\t\t\treturn twJoin(\n\t\t\t\tmultilineFillBaseClasses,\n\t\t\t\t'from-ui-yellow to-ui-yellow transition-[background-size_color] contrast-more:from-ui-yellow contrast-more:to-ui-yellow',\n\t\t\t)\n\t\tcase 'blue':\n\t\tdefault:\n\t\t\treturn twJoin(\n\t\t\t\tmultilineFillBaseClasses,\n\t\t\t\t'from-ui-blue to-ui-blue transition-[background-size_color] contrast-more:from-ui-blue contrast-more:to-ui-blue',\n\t\t\t)\n\t}\n}\n\n// Define theme-specific multiline fill classes\nconst getMultilineFillClasses = (theme: LinkProps['theme'] = 'blue') => {\n\tswitch (theme) {\n\t\tcase 'brown':\n\t\t\treturn twJoin(\n\t\t\t\tmultilineFillBaseClasses,\n\t\t\t\t'from-ui-brown/0 to-ui-brown/0 bg-[size:50%_0px] bg-[position:50%_50%] transition-[background-size_background-image_color] focus-visible:from-ui-brown focus-visible:to-ui-brown focus-visible:bg-[size:100%_100%] active:from-ui-brown active:to-ui-brown active:bg-[size:100%_100%] contrast-more:from-ui-brown/0 contrast-more:to-ui-brown/0 focus-visible:contrast-more:from-ui-brown focus-visible:contrast-more:to-ui-brown active:contrast-more:from-ui-brown active:contrast-more:to-ui-brown pointer-fine:hover:from-ui-brown pointer-fine:hover:to-ui-brown pointer-fine:hover:bg-[size:100%_100%] pointer-fine:hover:contrast-more:from-ui-brown pointer-fine:hover:contrast-more:to-ui-brown',\n\t\t\t)\n\t\tcase 'green':\n\t\t\treturn twJoin(\n\t\t\t\tmultilineFillBaseClasses,\n\t\t\t\t'from-ui-green/0 to-ui-green/0 bg-[size:50%_0px] bg-[position:50%_50%] transition-[background-size_background-image_color] focus-visible:from-ui-green focus-visible:to-ui-green focus-visible:bg-[size:100%_100%] active:from-ui-green active:to-ui-green active:bg-[size:100%_100%] contrast-more:from-ui-green/0 contrast-more:to-ui-green/0 focus-visible:contrast-more:from-ui-green focus-visible:contrast-more:to-ui-green active:contrast-more:from-ui-green active:contrast-more:to-ui-green pointer-fine:hover:from-ui-green pointer-fine:hover:to-ui-green pointer-fine:hover:bg-[size:100%_100%] pointer-fine:hover:contrast-more:from-ui-green pointer-fine:hover:contrast-more:to-ui-green',\n\t\t\t)\n\t\tcase 'grey':\n\t\t\treturn twJoin(\n\t\t\t\tmultilineFillBaseClasses,\n\t\t\t\t'from-ui-grey/0 to-ui-grey/0 bg-[size:50%_0px] bg-[position:50%_50%] transition-[background-size_background-image_color] focus-visible:from-ui-grey focus-visible:to-ui-grey focus-visible:bg-[size:100%_100%] active:from-ui-grey active:to-ui-grey active:bg-[size:100%_100%] contrast-more:from-ui-grey/0 contrast-more:to-ui-grey/0 focus-visible:contrast-more:from-ui-grey focus-visible:contrast-more:to-ui-grey active:contrast-more:from-ui-grey active:contrast-more:to-ui-grey pointer-fine:hover:from-ui-grey pointer-fine:hover:to-ui-grey pointer-fine:hover:bg-[size:100%_100%] pointer-fine:hover:contrast-more:from-ui-grey pointer-fine:hover:contrast-more:to-ui-grey',\n\t\t\t)\n\t\tcase 'sky-blue':\n\t\t\treturn twJoin(\n\t\t\t\tmultilineFillBaseClasses,\n\t\t\t\t'from-ui-sky-blue/0 to-ui-sky-blue/0 bg-[size:50%_0px] bg-[position:50%_50%] transition-[background-size_background-image_color] focus-visible:from-ui-sky-blue focus-visible:to-ui-sky-blue focus-visible:bg-[size:100%_100%] active:from-ui-sky-blue active:to-ui-sky-blue active:bg-[size:100%_100%] contrast-more:from-ui-sky-blue/0 contrast-more:to-ui-sky-blue/0 focus-visible:contrast-more:from-ui-sky-blue focus-visible:contrast-more:to-ui-sky-blue active:contrast-more:from-ui-sky-blue active:contrast-more:to-ui-sky-blue pointer-fine:hover:from-ui-sky-blue pointer-fine:hover:to-ui-sky-blue pointer-fine:hover:bg-[size:100%_100%] pointer-fine:hover:contrast-more:from-ui-sky-blue pointer-fine:hover:contrast-more:to-ui-sky-blue',\n\t\t\t)\n\t\tcase 'magenta':\n\t\t\treturn twJoin(\n\t\t\t\tmultilineFillBaseClasses,\n\t\t\t\t'from-ui-magenta/0 to-ui-magenta/0 bg-[size:50%_0px] bg-[position:50%_50%] transition-[background-size_background-image_color] focus-visible:from-ui-magenta focus-visible:to-ui-magenta focus-visible:bg-[size:100%_100%] active:from-ui-magenta active:to-ui-magenta active:bg-[size:100%_100%] contrast-more:from-ui-magenta/0 contrast-more:to-ui-magenta/0 focus-visible:contrast-more:from-ui-magenta focus-visible:contrast-more:to-ui-magenta active:contrast-more:from-ui-magenta active:contrast-more:to-ui-magenta pointer-fine:hover:from-ui-magenta pointer-fine:hover:to-ui-magenta pointer-fine:hover:bg-[size:100%_100%] pointer-fine:hover:contrast-more:from-ui-magenta pointer-fine:hover:contrast-more:to-ui-magenta',\n\t\t\t)\n\t\tcase 'neutral':\n\t\t\treturn twJoin(\n\t\t\t\tmultilineFillBaseClasses,\n\t\t\t\t'from-zinc-700/0 to-zinc-700/0 bg-[size:50%_0px] bg-[position:50%_50%] transition-[background-size_background-image_color] focus-visible:from-zinc-700 focus-visible:to-zinc-700 focus-visible:bg-[size:100%_100%] active:from-zinc-700 active:to-zinc-700 active:bg-[size:100%_100%] contrast-more:from-zinc-700/0 contrast-more:to-zinc-700/0 focus-visible:contrast-more:from-zinc-700 focus-visible:contrast-more:to-zinc-700 active:contrast-more:from-zinc-700 active:contrast-more:to-zinc-700 dark:from-zinc-300/0 dark:to-zinc-300/0 dark:focus-visible:from-zinc-300 dark:focus-visible:to-zinc-300 dark:active:from-zinc-300 dark:active:to-zinc-300 dark:contrast-more:from-zinc-300/0 dark:contrast-more:to-zinc-300/0 dark:focus-visible:contrast-more:from-zinc-300 dark:focus-visible:contrast-more:to-zinc-300 dark:active:contrast-more:from-zinc-300 dark:active:contrast-more:to-zinc-300 pointer-fine:hover:from-zinc-700 pointer-fine:hover:to-zinc-700 pointer-fine:hover:bg-[size:100%_100%] pointer-fine:hover:contrast-more:from-zinc-700 pointer-fine:hover:contrast-more:to-zinc-700 dark:pointer-fine:hover:from-zinc-300 dark:pointer-fine:hover:to-zinc-300 dark:pointer-fine:hover:contrast-more:from-zinc-300 dark:pointer-fine:hover:contrast-more:to-zinc-300',\n\t\t\t)\n\t\tcase 'orange':\n\t\t\treturn twJoin(\n\t\t\t\tmultilineFillBaseClasses,\n\t\t\t\t'from-ui-orange/0 to-ui-orange/0 bg-[size:50%_0px] bg-[position:50%_50%] transition-[background-size_background-image_color] focus-visible:from-ui-orange focus-visible:to-ui-orange focus-visible:bg-[size:100%_100%] active:from-ui-orange active:to-ui-orange active:bg-[size:100%_100%] contrast-more:from-ui-orange/0 contrast-more:to-ui-orange/0 focus-visible:contrast-more:from-ui-orange focus-visible:contrast-more:to-ui-orange active:contrast-more:from-ui-orange active:contrast-more:to-ui-orange pointer-fine:hover:from-ui-orange pointer-fine:hover:to-ui-orange pointer-fine:hover:bg-[size:100%_100%] pointer-fine:hover:contrast-more:from-ui-orange pointer-fine:hover:contrast-more:to-ui-orange',\n\t\t\t)\n\t\tcase 'pink':\n\t\t\treturn twJoin(\n\t\t\t\tmultilineFillBaseClasses,\n\t\t\t\t'from-ui-pink/0 to-ui-pink/0 bg-[size:50%_0px] bg-[position:50%_50%] transition-[background-size_background-image_color] focus-visible:from-ui-pink focus-visible:to-ui-pink focus-visible:bg-[size:100%_100%] active:from-ui-pink active:to-ui-pink active:bg-[size:100%_100%] contrast-more:from-ui-pink/0 contrast-more:to-ui-pink/0 focus-visible:contrast-more:from-ui-pink focus-visible:contrast-more:to-ui-pink active:contrast-more:from-ui-pink active:contrast-more:to-ui-pink pointer-fine:hover:from-ui-pink pointer-fine:hover:to-ui-pink pointer-fine:hover:bg-[size:100%_100%] pointer-fine:hover:contrast-more:from-ui-pink pointer-fine:hover:contrast-more:to-ui-pink',\n\t\t\t)\n\t\tcase 'purple':\n\t\t\treturn twJoin(\n\t\t\t\tmultilineFillBaseClasses,\n\t\t\t\t'from-ui-purple/0 to-ui-purple/0 bg-[size:50%_0px] bg-[position:50%_50%] transition-[background-size_background-image_color] focus-visible:from-ui-purple focus-visible:to-ui-purple focus-visible:bg-[size:100%_100%] active:from-ui-purple active:to-ui-purple active:bg-[size:100%_100%] contrast-more:from-ui-purple/0 contrast-more:to-ui-purple/0 focus-visible:contrast-more:from-ui-purple focus-visible:contrast-more:to-ui-purple active:contrast-more:from-ui-purple active:contrast-more:to-ui-purple pointer-fine:hover:from-ui-purple pointer-fine:hover:to-ui-purple pointer-fine:hover:bg-[size:100%_100%] pointer-fine:hover:contrast-more:from-ui-purple pointer-fine:hover:contrast-more:to-ui-purple',\n\t\t\t)\n\t\tcase 'red':\n\t\t\treturn twJoin(\n\t\t\t\tmultilineFillBaseClasses,\n\t\t\t\t'from-ui-red/0 to-ui-red/0 bg-[size:50%_0px] bg-[position:50%_50%] transition-[background-size_background-image_color] focus-visible:from-ui-red focus-visible:to-ui-red focus-visible:bg-[size:100%_100%] active:from-ui-red active:to-ui-red active:bg-[size:100%_100%] contrast-more:from-ui-red/0 contrast-more:to-ui-red/0 focus-visible:contrast-more:from-ui-red focus-visible:contrast-more:to-ui-red active:contrast-more:from-ui-red active:contrast-more:to-ui-red pointer-fine:hover:from-ui-red pointer-fine:hover:to-ui-red pointer-fine:hover:bg-[size:100%_100%] pointer-fine:hover:contrast-more:from-ui-red pointer-fine:hover:contrast-more:to-ui-red',\n\t\t\t)\n\t\tcase 'violet':\n\t\t\treturn twJoin(\n\t\t\t\tmultilineFillBaseClasses,\n\t\t\t\t'from-ui-violet/0 to-ui-violet/0 bg-[size:50%_0px] bg-[position:50%_50%] transition-[background-size_background-image_color] focus-visible:from-ui-violet focus-visible:to-ui-violet focus-visible:bg-[size:100%_100%] active:from-ui-violet active:to-ui-violet active:bg-[size:100%_100%] contrast-more:from-ui-violet/0 contrast-more:to-ui-violet/0 focus-visible:contrast-more:from-ui-violet focus-visible:contrast-more:to-ui-violet active:contrast-more:from-ui-violet active:contrast-more:to-ui-violet pointer-fine:hover:from-ui-violet pointer-fine:hover:to-ui-violet pointer-fine:hover:bg-[size:100%_100%] pointer-fine:hover:contrast-more:from-ui-violet pointer-fine:hover:contrast-more:to-ui-violet',\n\t\t\t)\n\t\tcase 'yellow':\n\t\t\treturn twJoin(\n\t\t\t\tmultilineFillBaseClasses,\n\t\t\t\t'from-ui-yellow/0 to-ui-yellow/0 bg-[size:50%_0px] bg-[position:50%_50%] transition-[background-size_background-image_color] focus-visible:from-ui-yellow focus-visible:to-ui-yellow focus-visible:bg-[size:100%_100%] active:from-ui-yellow active:to-ui-yellow active:bg-[size:100%_100%] contrast-more:from-ui-yellow/0 contrast-more:to-ui-yellow/0 focus-visible:contrast-more:from-ui-yellow focus-visible:contrast-more:to-ui-yellow active:contrast-more:from-ui-yellow active:contrast-more:to-ui-yellow pointer-fine:hover:from-ui-yellow pointer-fine:hover:to-ui-yellow pointer-fine:hover:bg-[size:100%_100%] pointer-fine:hover:contrast-more:from-ui-yellow pointer-fine:hover:contrast-more:to-ui-yellow',\n\t\t\t)\n\t\tcase 'blue':\n\t\tdefault:\n\t\t\treturn twJoin(\n\t\t\t\tmultilineFillBaseClasses,\n\t\t\t\t'from-ui-blue/0 to-ui-blue/0 bg-[size:50%_0px] bg-[position:50%_50%] transition-[background-size_background-image_color] focus-visible:from-ui-blue focus-visible:to-ui-blue focus-visible:bg-[size:100%_100%] active:from-ui-blue active:to-ui-blue active:bg-[size:100%_100%] contrast-more:from-ui-blue/0 contrast-more:to-ui-blue/0 focus-visible:contrast-more:from-ui-blue focus-visible:contrast-more:to-ui-blue active:contrast-more:from-ui-blue active:contrast-more:to-ui-blue pointer-fine:hover:from-ui-blue pointer-fine:hover:to-ui-blue pointer-fine:hover:bg-[size:100%_100%] pointer-fine:hover:contrast-more:from-ui-blue pointer-fine:hover:contrast-more:to-ui-blue',\n\t\t\t)\n\t}\n}\n\nconst getMultilineFillLiftClasses = (theme: LinkProps['theme'] = 'blue') => {\n\treturn twJoin(\n\t\tgetMultilineFillColorClasses(theme),\n\t\t'bg-[size:auto_0px] bg-[position:50%_100%] focus-visible:bg-[size:auto_100%] active:bg-[size:auto_100%] pointer-fine:hover:bg-[size:auto_100%]',\n\t)\n}\n\nconst getMultilineFillXClasses = (theme: LinkProps['theme'] = 'blue') => {\n\treturn twJoin(\n\t\tgetMultilineFillColorClasses(theme),\n\t\t'bg-[size:0%_100%] focus-visible:bg-[size:100%_100%] active:bg-[size:100%_100%] pointer-fine:hover:bg-[size:100%_100%]',\n\t)\n}\n\nconst getMultilineFillRtlClasses = (theme: LinkProps['theme'] = 'blue') => {\n\treturn twJoin(getMultilineFillXClasses(theme), 'bg-[position:100%_auto]')\n}\n\nconst getMultilineFillCenterClasses = (theme: LinkProps['theme'] = 'blue') => {\n\treturn twJoin(getMultilineFillXClasses(theme), 'bg-[position:50%_auto]')\n}\n\n/**\n * # Link\n *\n * - A component for rendering links with various styles and options.\n * - Utilizes the Next.js `Link` component and provides additional functionality.\n *\n * ---\n *\n * ## Styles\n *\n * This component includes various classes to style the link. The styles are divided into two types:\n *\n * - Line styles: These styles add a line underneath the link, and include variations for different positions and orientations.\n * - Fill styles: These styles add a background color behind the link, and include variations for different positions and orientations.\n * - Multiline styles: These styles seek to accomplish the same as the line and fill styles, while offering multiline support.\n *\n * ---\n *\n * ## Examples\n *\n * @example\n * <Link href='/about' type='ltr' title='About Us'>Learn more about our company</Link>\n *\n * @example\n * <Link href='/about' type='fill-ltr' title='About Us'>Learn more about our company</Link>\n *\n * @example\n * <Link href='/about' type='fill-ltr' theme='red' title='About Us'>Learn more about our company</Link>\n */\nexport default function Link({ as, className, ref, theme = 'blue', type, ...props }: LinkProps) {\n\tconst getLinkClasses = () => {\n\t\tswitch (type) {\n\t\t\tcase 'static':\n\t\t\t\treturn lineStaticClasses\n\t\t\tcase 'ltr':\n\t\t\t\treturn lineLtrClasses\n\t\t\tcase 'rtl':\n\t\t\t\treturn lineRtlClasses\n\t\t\tcase 'center':\n\t\t\t\treturn lineCenterClasses\n\t\t\tcase 'lift':\n\t\t\t\treturn lineLiftClasses\n\t\t\tcase 'fill':\n\t\t\t\treturn getFillCenterClasses(theme)\n\t\t\tcase 'fill-ltr':\n\t\t\t\treturn twJoin([getFillColorTransitionClasses(theme), scaleXClasses, 'after:origin-left'])\n\t\t\tcase 'fill-rtl':\n\t\t\t\treturn twJoin([getFillColorTransitionClasses(theme), scaleXClasses, 'after:origin-right'])\n\t\t\tcase 'fill-lift':\n\t\t\t\treturn twJoin([getFillColorTransitionClasses(theme), scaleYClasses, 'after:origin-bottom'])\n\t\t\tcase 'multiline':\n\t\t\t\treturn multilineNormalClasses\n\t\t\tcase 'multiline-static':\n\t\t\t\treturn multilineLineStaticClasses\n\t\t\tcase 'multiline-ltr':\n\t\t\t\treturn multilineXClasses\n\t\t\tcase 'multiline-rtl':\n\t\t\t\treturn multilineLineRtlClasses\n\t\t\tcase 'multiline-center':\n\t\t\t\treturn multilineLineCenterClasses\n\t\t\tcase 'multiline-lift':\n\t\t\t\treturn multilineLineLiftClasses\n\t\t\tcase 'multiline-fill':\n\t\t\t\treturn getMultilineFillClasses(theme)\n\t\t\tcase 'multiline-fill-ltr':\n\t\t\t\treturn getMultilineFillXClasses(theme)\n\t\t\tcase 'multiline-fill-rtl':\n\t\t\t\treturn getMultilineFillRtlClasses(theme)\n\t\t\tcase 'multiline-fill-center':\n\t\t\t\treturn getMultilineFillCenterClasses(theme)\n\t\t\tcase 'multiline-fill-lift':\n\t\t\t\treturn getMultilineFillLiftClasses(theme)\n\t\t\tdefault:\n\t\t\t\treturn lineNormalClasses\n\t\t}\n\t}\n\n\tconst linkClasses = getLinkClasses()\n\n\tconst LinkElement = as || Anchor\n\n\treturn <LinkElement {...props} className={twMerge(linkClasses, className)} ref={ref} />\n}\n","// * Types\nimport { ButtonHTMLAttributes, RefObject } from 'react'\nimport { OneOf } from '../types'\n\ntype HtmlButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & { ref?: RefObject<HTMLButtonElement | null> }\n\ntype LinkOrButtonProps<T extends HTMLButtonElement | HTMLAnchorElement | unknown> = [T] extends [HTMLButtonElement]\n\t? HtmlButtonProps\n\t: [T] extends [HTMLAnchorElement]\n\t\t? AnchorProps\n\t\t: OneOf<[AnchorProps, HtmlButtonProps]>\n\nexport type ButtonProps<T extends HTMLButtonElement | HTMLAnchorElement | unknown> = LinkOrButtonProps<T> & {\n\t/** The size of the element based on padding. */\n\tpadding?: 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl'\n\t/** The size of the border-1 radius. */\n\trounded?: 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'full'\n\t/** Color theme. */\n\ttheme?:\n\t\t| 'blue'\n\t\t| 'blue-gradient'\n\t\t| 'brown'\n\t\t| 'brown-gradient'\n\t\t| 'green'\n\t\t| 'green-gradient'\n\t\t| 'grey'\n\t\t| 'grey-gradient'\n\t\t| 'sky-blue'\n\t\t| 'sky-blue-gradient'\n\t\t| 'magenta'\n\t\t| 'magenta-gradient'\n\t\t| 'neutral'\n\t\t| 'neutral-gradient'\n\t\t| 'orange'\n\t\t| 'orange-gradient'\n\t\t| 'pink'\n\t\t| 'pink-gradient'\n\t\t| 'purple'\n\t\t| 'purple-gradient'\n\t\t| 'red'\n\t\t| 'red-gradient'\n\t\t| 'violet'\n\t\t| 'violet-gradient'\n\t\t| 'yellow'\n\t\t| 'yellow-gradient'\n}\n\n// * Components\nimport { Anchor, AnchorProps } from './link'\nimport { Button as HeadlessButton } from '@headlessui/react'\n\n// * Utilities\nimport { twMerge, twSort } from '../utils'\n\n/**\n * # Button\n * - A pre-styled button with utility props for easy customization depending on use case.\n */\nexport default function Button<T extends HTMLButtonElement | HTMLAnchorElement | unknown = unknown>({\n\tclassName,\n\tpadding = 'md',\n\trounded = 'lg',\n\ttheme = 'blue',\n\tref,\n\t...props\n}: ButtonProps<T>) {\n\tconst getPaddingClasses = () => {\n\t\tswitch (padding) {\n\t\t\tcase 'xs':\n\t\t\t\treturn 'px-2 py-0.5'\n\t\t\tcase 'sm':\n\t\t\t\treturn 'px-4 py-1'\n\t\t\tcase 'md':\n\t\t\t\treturn 'px-6 py-1.5'\n\t\t\tcase 'lg':\n\t\t\t\treturn 'px-8 py-2'\n\t\t\tcase 'xl':\n\t\t\t\treturn 'px-12 py-3'\n\t\t}\n\t}\n\n\tconst getRoundedClasses = () => {\n\t\tswitch (rounded) {\n\t\t\tcase 'xs':\n\t\t\t\treturn 'rounded-sm'\n\t\t\tcase 'sm':\n\t\t\t\treturn 'rounded-md'\n\t\t\tcase 'md':\n\t\t\t\treturn 'rounded-lg'\n\t\t\tcase 'lg':\n\t\t\t\treturn 'rounded-xl'\n\t\t\tcase 'xl':\n\t\t\t\treturn 'rounded-3xl'\n\t\t\tcase 'full':\n\t\t\t\treturn 'rounded-full'\n\t\t}\n\t}\n\n\tconst getThemeClasses = () => {\n\t\tconst classList = []\n\n\t\tswitch (theme) {\n\t\t\tcase 'blue':\n\t\t\t\tclassList.push(\n\t\t\t\t\ttwSort(\n\t\t\t\t\t\t'text-white shadow-lg shadow-ui-blue/25 transition-transform before:absolute before:inset-0 before:-z-10 before:rounded-[inherit] before:bg-ui-blue before:transition-[filter] before:duration-300 before:ease-exponential active:before:brightness-90 pointer-fine:hover:before:brightness-110 pointer-fine:active:before:brightness-90',\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t\tbreak\n\t\t\tcase 'blue-gradient':\n\t\t\t\tclassList.push(\n\t\t\t\t\ttwSort(\n\t\t\t\t\t\t'bg-ui-blue text-white shadow-lg shadow-ui-blue/25 transition-transform before:absolute before:inset-0 before:rounded-[inherit] before:bg-linear-to-t before:from-black/75 before:via-transparent before:to-white/75 before:opacity-75 before:mix-blend-soft-light before:transition-[filter] before:duration-300 before:ease-exponential active:before:brightness-90 pointer-fine:hover:before:brightness-110 pointer-fine:active:before:brightness-90',\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t\tbreak\n\t\t\tcase 'brown':\n\t\t\t\tclassList.push(\n\t\t\t\t\ttwSort(\n\t\t\t\t\t\t'text-white shadow-lg shadow-ui-brown/25 transition-transform before:absolute before:inset-0 before:-z-10 before:rounded-[inherit] before:bg-ui-brown before:transition-[filter] before:duration-300 before:ease-exponential active:before:brightness-90 pointer-fine:hover:before:brightness-110 pointer-fine:active:before:brightness-90',\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t\tbreak\n\t\t\tcase 'brown-gradient':\n\t\t\t\tclassList.push(\n\t\t\t\t\ttwSort(\n\t\t\t\t\t\t'bg-ui-brown text-white shadow-lg shadow-ui-brown/25 transition-transform before:absolute before:inset-0 before:rounded-[inherit] before:bg-linear-to-t before:from-black/75 before:via-transparent before:to-white/75 before:opacity-75 before:mix-blend-soft-light before:transition-[filter] before:duration-300 before:ease-exponential active:before:brightness-90 pointer-fine:hover:before:brightness-110 pointer-fine:active:before:brightness-90',\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t\tbreak\n\t\t\tcase 'green':\n\t\t\t\tclassList.push(\n\t\t\t\t\ttwSort(\n\t\t\t\t\t\t'text-white shadow-lg shadow-ui-green/25 transition-transform before:absolute before:inset-0 before:-z-10 before:rounded-[inherit] before:bg-ui-green before:transition-[filter] before:duration-300 before:ease-exponential active:before:brightness-90 pointer-fine:hover:before:brightness-110 pointer-fine:active:before:brightness-90',\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t\tbreak\n\t\t\tcase 'green-gradient':\n\t\t\t\tclassList.push(\n\t\t\t\t\ttwSort(\n\t\t\t\t\t\t'bg-ui-green text-white shadow-lg shadow-ui-green/25 transition-transform before:absolute before:inset-0 before:rounded-[inherit] before:bg-linear-to-t before:from-black/75 before:via-transparent before:to-white/75 before:opacity-75 before:mix-blend-soft-light before:transition-[filter] before:duration-300 before:ease-exponential active:before:brightness-90 pointer-fine:hover:before:brightness-110 pointer-fine:active:before:brightness-90',\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t\tbreak\n\t\t\tcase 'grey':\n\t\t\t\tclassList.push(\n\t\t\t\t\ttwSort(\n\t\t\t\t\t\t'text-white shadow-lg shadow-ui-grey/25 transition-transform before:absolute before:inset-0 before:-z-10 before:rounded-[inherit] before:bg-ui-grey before:transition-[filter] before:duration-300 before:ease-exponential active:before:brightness-90 pointer-fine:hover:before:brightness-110 pointer-fine:active:before:brightness-90',\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t\tbreak\n\t\t\tcase 'grey-gradient':\n\t\t\t\tclassList.push(\n\t\t\t\t\ttwSort(\n\t\t\t\t\t\t'bg-ui-grey text-white shadow-lg shadow-ui-grey/25 transition-transform before:absolute before:inset-0 before:rounded-[inherit] before:bg-linear-to-t before:from-black/75 before:via-transparent before:to-white/75 before:opacity-75 before:mix-blend-soft-light before:transition-[filter] before:duration-300 before:ease-exponential active:before:brightness-90 pointer-fine:hover:before:brightness-110 pointer-fine:active:before:brightness-90',\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t\tbreak\n\t\t\tcase 'sky-blue':\n\t\t\t\tclassList.push(\n\t\t\t\t\ttwSort(\n\t\t\t\t\t\t'text-white shadow-lg shadow-ui-sky-blue/25 transition-transform before:absolute before:inset-0 before:-z-10 before:rounded-[inherit] before:bg-ui-sky-blue before:transition-[filter] before:duration-300 before:ease-exponential active:before:brightness-90 pointer-fine:hover:before:brightness-110 pointer-fine:active:before:brightness-90',\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t\tbreak\n\t\t\tcase 'sky-blue-gradient':\n\t\t\t\tclassList.push(\n\t\t\t\t\ttwSort(\n\t\t\t\t\t\t'bg-ui-sky-blue text-white shadow-lg shadow-ui-sky-blue/25 transition-transform before:absolute before:inset-0 before:rounded-[inherit] before:bg-linear-to-t before:from-black/75 before:via-transparent before:to-white/75 before:opacity-75 before:mix-blend-soft-light before:transition-[filter] before:duration-300 before:ease-exponential active:before:brightness-90 pointer-fine:hover:before:brightness-110 pointer-fine:active:before:brightness-90',\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t\tbreak\n\t\t\tcase 'magenta':\n\t\t\t\tclassList.push(\n\t\t\t\t\ttwSort(\n\t\t\t\t\t\t'text-white shadow-lg shadow-ui-magenta/25 transition-transform before:absolute before:inset-0 before:-z-10 before:rounded-[inherit] before:bg-ui-magenta before:transition-[filter] before:duration-300 before:ease-exponential active:before:brightness-90 pointer-fine:hover:before:brightness-110 pointer-fine:active:before:brightness-90',\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t\tbreak\n\t\t\tcase 'magenta-gradient':\n\t\t\t\tclassList.push(\n\t\t\t\t\ttwSort(\n\t\t\t\t\t\t'bg-ui-magenta text-white shadow-lg shadow-ui-magenta/25 transition-transform before:absolute before:inset-0 before:rounded-[inherit] before:bg-linear-to-t before:from-black/75 before:via-transparent before:to-white/75 before:opacity-75 before:mix-blend-soft-light before:transition-[filter] before:duration-300 before:ease-exponential active:before:brightness-90 pointer-fine:hover:before:brightness-110 pointer-fine:active:before:brightness-90',\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t\tbreak\n\t\t\tcase 'neutral':\n\t\t\t\tclassList.push(\n\t\t\t\t\ttwSort(\n\t\t\t\t\t\t'pointer-fine:active:before:brightness-90text-white dark bg-zinc-200 text-black before:absolute before:inset-0 before:rounded-[inherit] before:transition-[filter] before:duration-300 before:ease-exponential active:before:brightness-90 dark:bg-zinc-800 pointer-fine:hover:before:brightness-110',\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t\tbreak\n\t\t\tcase 'neutral-gradient':\n\t\t\t\tclassList.push(\n\t\t\t\t\ttwSort(\n\t\t\t\t\t\t'dark bg-linear-to-t from-zinc-300 via-zinc-200 to-zinc-100 text-black before:transition-[filter] before:duration-300 before:ease-exponential active:before:brightness-90 dark:from-zinc-900 dark:via-zinc-800 dark:to-zinc-700 pointer-fine:hover:before:brightness-110 pointer-fine:active:before:brightness-90',\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t\tbreak\n\t\t\tcase 'orange':\n\t\t\t\tclassList.push(\n\t\t\t\t\ttwSort(\n\t\t\t\t\t\t'text-white shadow-lg shadow-ui-orange/25 transition-transform before:absolute before:inset-0 before:-z-10 before:rounded-[inherit] before:bg-ui-orange before:transition-[filter] before:duration-300 before:ease-exponential active:before:brightness-90 pointer-fine:hover:before:brightness-110 pointer-fine:active:before:brightness-90',\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t\tbreak\n\t\t\tcase 'orange-gradient':\n\t\t\t\tclassList.push(\n\t\t\t\t\ttwSort(\n\t\t\t\t\t\t'bg-ui-orange text-white shadow-lg shadow-ui-orange/25 transition-transform before:absolute before:inset-0 before:rounded-[inherit] before:bg-linear-to-t before:from-black/75 before:via-transparent before:to-white/75 before:opacity-75 before:mix-blend-soft-light before:transition-[filter] before:duration-300 before:ease-exponential active:before:brightness-90 pointer-fine:hover:before:brightness-110 pointer-fine:active:before:brightness-90',\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t\tbreak\n\t\t\tcase 'pink':\n\t\t\t\tclassList.push(\n\t\t\t\t\ttwSort(\n\t\t\t\t\t\t'text-white shadow-lg shadow-ui-pink/25 transition-transform before:absolute before:inset-0 before:-z-10 before:rounded-[inherit] before:bg-ui-pink before:transition-[filter] before:duration-300 before:ease-exponential active:before:brightness-90 pointer-fine:hover:before:brightness-110 pointer-fine:active:before:brightness-90',\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t\tbreak\n\t\t\tcase 'pink-gradient':\n\t\t\t\tclassList.push(\n\t\t\t\t\ttwSort(\n\t\t\t\t\t\t'before:to-white/75/75 bg-ui-pink text-white shadow-lg shadow-ui-pink/25 transition-transform before:absolute before:inset-0 before:rounded-[inherit] before:bg-linear-to-t before:from-black/75 before:via-transparent before:opacity-75 before:mix-blend-soft-light before:transition-[filter] before:duration-300 before:ease-exponential active:before:brightness-90 pointer-fine:hover:before:brightness-110 pointer-fine:active:before:brightness-90',\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t\tbreak\n\t\t\tcase 'purple':\n\t\t\t\tclassList.push(\n\t\t\t\t\ttwSort(\n\t\t\t\t\t\t'text-white shadow-lg shadow-ui-purple/25 transition-transform before:absolute before:inset-0 before:-z-10 before:rounded-[inherit] before:bg-ui-purple before:transition-[filter] before:duration-300 before:ease-exponential active:before:brightness-90 pointer-fine:hover:before:brightness-110 pointer-fine:active:before:brightness-90',\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t\tbreak\n\t\t\tcase 'purple-gradient':\n\t\t\t\tclassList.push(\n\t\t\t\t\ttwSort(\n\t\t\t\t\t\t'bg-ui-purple text-white shadow-lg shadow-ui-purple/25 transition-transform before:absolute before:inset-0 before:rounded-[inherit] before:bg-linear-to-t before:from-black/75 before:via-transparent before:to-white/75 before:opacity-75 before:mix-blend-soft-light before:transition-[filter] before:duration-300 before:ease-exponential active:before:brightness-90 pointer-fine:hover:before:brightness-110 pointer-fine:active:before:brightness-90',\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t\tbreak\n\t\t\tcase 'red':\n\t\t\t\tclassList.push(\n\t\t\t\t\ttwSort(\n\t\t\t\t\t\t'text-white shadow-lg shadow-ui-red/25 transition-transform before:absolute before:inset-0 before:-z-10 before:rounded-[inherit] before:bg-ui-red before:transition-[filter] before:duration-300 before:ease-exponential active:before:brightness-90 pointer-fine:hover:before:brightness-110 pointer-fine:active:before:brightness-90',\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t\tbreak\n\t\t\tcase 'red-gradient':\n\t\t\t\tclassList.push(\n\t\t\t\t\ttwSort(\n\t\t\t\t\t\t'bg-ui-red text-white shadow-lg shadow-ui-red/25 transition-transform before:absolute before:inset-0 before:rounded-[inherit] before:bg-linear-to-t before:from-black/75 before:via-transparent before:to-white/75 before:opacity-75 before:mix-blend-soft-light before:transition-[filter] before:duration-300 before:ease-exponential active:before:brightness-90 pointer-fine:hover:before:brightness-110 pointer-fine:active:before:brightness-90',\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t\tbreak\n\t\t\tcase 'violet':\n\t\t\t\tclassList.push(\n\t\t\t\t\ttwSort(\n\t\t\t\t\t\t'text-white shadow-lg shadow-ui-violet/25 transition-transform before:absolute before:inset-0 before:-z-10 before:rounded-[inherit] before:bg-ui-violet before:transition-[filter] before:duration-300 before:ease-exponential active:before:brightness-90 pointer-fine:hover:before:brightness-110 pointer-fine:active:before:brightness-90',\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t\tbreak\n\t\t\tcase 'violet-gradient':\n\t\t\t\tclassList.push(\n\t\t\t\t\ttwSort(\n\t\t\t\t\t\t'bg-ui-violet text-white shadow-lg shadow-ui-violet/25 transition-transform before:absolute before:inset-0 before:rounded-[inherit] before:bg-linear-to-t before:from-black/75 before:via-transparent before:to-white/75 before:opacity-75 before:mix-blend-soft-light before:transition-[filter] before:duration-300 before:ease-exponential active:before:brightness-90 pointer-fine:hover:before:brightness-110 pointer-fine:active:before:brightness-90',\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t\tbreak\n\t\t\tcase 'yellow':\n\t\t\t\tclassList.push(\n\t\t\t\t\ttwSort(\n\t\t\t\t\t\t'text-black shadow-lg shadow-ui-yellow/25 transition-transform before:absolute before:inset-0 before:-z-10 before:rounded-[inherit] before:bg-ui-yellow before:transition-[filter] before:duration-300 before:ease-exponential active:before:brightness-90 pointer-fine:hover:before:brightness-110 pointer-fine:active:before:brightness-90',\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t\tbreak\n\t\t\tcase 'yellow-gradient':\n\t\t\t\tclassList.push(\n\t\t\t\t\ttwSort(\n\t\t\t\t\t\t'bg-ui-yellow text-black shadow-lg shadow-ui-yellow/25 transition-transform before:absolute before:inset-0 before:rounded-[inherit] before:bg-linear-to-t before:from-black before:via-black/50 before:to-white/50 before:opacity-75 before:mix-blend-soft-light before:transition-[filter] before:duration-300 before:ease-exponential active:before:brightness-90 pointer-fine:hover:before:brightness-110 pointer-fine:active:before:brightness-90',\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t\tbreak\n\t\t}\n\n\t\treturn classList.join(' ')\n\t}\n\n\tconst paddingClasses = getPaddingClasses(),\n\t\troundedClasses = getRoundedClasses(),\n\t\tthemeClasses = getThemeClasses()\n\n\tconst buttonClasses = twMerge([\n\t\t'block w-fit min-w-fit text-center font-semibold duration-300 ease-exponential focus-visible:scale-101 active:scale-95 pointer-fine:hover:scale-101 pointer-fine:active:scale-99',\n\t\tpaddingClasses,\n\t\troundedClasses,\n\t\tthemeClasses,\n\t\tclassName,\n\t])\n\n\treturn 'href' in props && typeof props.href === 'string' ? (\n\t\t<Anchor ref={ref as RefObject<HTMLAnchorElement | null>} {...(props as AnchorProps)} className={buttonClasses} />\n\t) : (\n\t\t<HeadlessButton\n\t\t\tref={ref as RefObject<HTMLButtonElement | null>}\n\t\t\t{...(props as HtmlButtonProps)}\n\t\t\tclassName={buttonClasses}\n\t\t/>\n\t)\n}\n","// * React\nimport { HTMLAttributes, useRef, createContext, useContext, useSyncExternalStore } from 'react'\n\nexport default function createFastContext<Store>(defaultInitialState: Store) {\n\tfunction useStoreData(initialState: Store = defaultInitialState): {\n\t\tget: () => Store\n\t\tset: (value: Store | ((prevState: Store) => Store)) => void\n\t\tsubscribe: (callback: () => void) => () => void\n\t} {\n\t\tconst store = useRef(initialState),\n\t\t\tget = () => store.current,\n\t\t\tsubscribers = useRef(new Set<() => void>())\n\n\t\tconst set = (value: Store | ((prevState: Store) => Store)) => {\n\t\t\tif (typeof value === 'function') {\n\t\t\t\tstore.current = (value as (prevState: Store) => Store)(store.current)\n\t\t\t} else {\n\t\t\t\tstore.current = value\n\t\t\t}\n\t\t\tsubscribers.current.forEach(callback => callback())\n\t\t}\n\n\t\tconst subscribe = (callback: () => void) => {\n\t\t\tsubscribers.current.add(callback)\n\t\t\treturn () => subscribers.current.delete(callback)\n\t\t}\n\n\t\treturn {\n\t\t\tget,\n\t\t\tset,\n\t\t\tsubscribe,\n\t\t}\n\t}\n\n\ttype UseStoreDataReturnType = ReturnType<typeof useStoreData>\n\n\tconst StoreContext = createContext<UseStoreDataReturnType | null>(null)\n\n\tfunction Provider({\n\t\tinitialValue = defaultInitialState,\n\t\t...props\n\t}: Pick<HTMLAttributes<HTMLElement>, 'children'> & { initialValue?: Store }) {\n\t\treturn <StoreContext.Provider value={useStoreData(initialValue)} {...props} />\n\t}\n\n\tfunction useStore<SelectorOutput>(\n\t\tselector: (store: Store) => SelectorOutput,\n\t\tinitialValue?: Store,\n\t): [SelectorOutput | undefined, ((value: Store | ((prevState: Store) => Store)) => void) | undefined] {\n\t\tconst store = useContext(StoreContext)\n\n\t\tif (!store) {\n\t\t\tconst localStoreValue = initialValue !== undefined ? initialValue : defaultInitialState\n\n\t\t\tconst selectedValue = selector(localStoreValue)\n\t\t\tconst noOpSet = () => console.warn('Attempting to set store value outside of Provider')\n\n\t\t\treturn [selectedValue, noOpSet]\n\t\t}\n\n\t\tconst state = useSyncExternalStore(\n\t\t\tstore.subscribe,\n\t\t\t() => selector(store.get()),\n\t\t\t() => selector(initialValue !== undefined ? initialValue : defaultInitialState),\n\t\t)\n\n\t\treturn [state, store.set]\n\t}\n\n\treturn {\n\t\tProvider,\n\t\tuseStore,\n\t}\n}\n","// * Types\nimport { ReactNode } from 'react'\n\nexport type FieldType = 'array' | 'email' | 'file' | 'number' | 'object' | 'string' | 'tel' | 'textarea' | 'url'\n\ntype ArrayObjectOrNormalField =\n\t| { type: 'email' | 'file' | 'number' | 'string' | 'tel' | 'textarea' | 'url' }\n\t| { type: 'array'; of: ArrayObjectOrNormalField }\n\t| { type: 'object'; fields: Field[] }\n\nexport type Field = ArrayObjectOrNormalField & {\n\tid: string\n\tinvalid?: boolean\n\tname: string\n\trequired?: boolean\n\tvalue: string\n}\n\nexport type FormContext = Field[]\n\n// * Hooks\nimport createFastContext from './create-fast-context'\n\n/**\n * # Define Field\n *\n * This is a helper function to define a field in a form context with type safety.\n */\nexport function defineField(fieldDefinition: Field) {\n\treturn fieldDefinition\n}\n\nconst { Provider, useStore } = createFastContext<FormContext>([])\n\nexport function FormContextProvider({ children }: { children?: ReactNode }) {\n\treturn <Provider>{children}</Provider>\n}\n\nexport function useFormContext() {\n\treturn useStore(store => store)\n}\n","// * Types\nimport { ReactNode, Suspense } from 'react'\n\nexport type FormStatus = 'error' | 'incomplete' | 'loading' | 'ready' | 'success' | 'readonly'\n\n// * Hooks\nimport createFastContext from './create-fast-context'\n\nconst DEFAULT_STATUS: FormStatus = 'incomplete'\n\nconst { Provider, useStore } = createFastContext<FormStatus>(DEFAULT_STATUS)\n\nexport function FormStatusProvider({\n\tchildren,\n\tinitialStatus = DEFAULT_STATUS,\n}: {\n\tchildren?: ReactNode\n\tinitialStatus?: FormStatus\n}) {\n\treturn (\n\t\t<Suspense>\n\t\t\t<Provider initialValue={initialStatus}>{children}</Provider>\n\t\t</Suspense>\n\t)\n}\n\nexport function useFormStatus() {\n\treturn useStore(store => store)\n}\n","// * Types\nimport {\n\tChangeEventHandler,\n\tFocusEventHandler,\n\tHTMLInputTypeAttribute,\n\tReactNode,\n\tRefObject,\n\tuseEffect,\n\tuseId,\n\tuseRef,\n} from 'react'\nimport { OneOf } from '../../../types'\n\ntype PasswordOptionList = {\n\tmatchPreviousInput: boolean\n\trequireLowercaseCharacter: boolean\n\trequireNumber: boolean\n\trequireSpecialCharacter: boolean\n\trequireUppercaseCharacter: boolean\n}\n\ntype TypeOfPasswordOrNot = OneOf<\n\t[\n\t\t{\n\t\t\ttype?: 'password'\n\t\t\tpasswordOptions?: Partial<PasswordOptionList>\n\t\t},\n\t\t{\n\t\t\ttype?: Exclude<HTMLInputTypeAttribute, 'password'>\n\t\t},\n\t]\n>\n\nexport type InputProps = Omit<HeadlessInputProps, 'name' | 'type'> &\n\tTypeOfPasswordOrNot & {\n\t\tdescription?: ReactNode\n\t\tdescriptionProps?: Omit<DescriptionProps, 'children'> & {\n\t\t\t/** @deprecated Use the `description` prop instead. */\n\t\t\tchildren?: never\n\t\t}\n\t\tfieldProps?: Omit<FieldProps, 'children' | 'disabled'>\n\t\tlabel?: ReactNode\n\t\tlabelProps?: Omit<LabelProps, 'children'> & {\n\t\t\t/** @deprecated Use the `label` prop instead. */\n\t\t\tchildren?: never\n\t\t}\n\t\tname: string\n\t\tref?: RefObject<HTMLInputElement | null>\n\t}\n\n// * Hooks\nimport { defineField, Field as FieldContext, useFormContext } from '../../../hooks'\n\n// * Headless UI\nimport {\n\tDescription,\n\tDescriptionProps,\n\tField,\n\tFieldProps,\n\tInput as HeadlessInput,\n\tInputProps as HeadlessInputProps,\n\tLabel,\n\tLabelProps,\n} from '@headlessui/react'\n\n// * Utilities\nimport { formatPhoneNumber, isEmail, isPhoneNumber, toLowerCase, twMerge } from '../../../utils'\n\nfunction validateField(value: string, { required, type }: FieldContext) {\n\tconst noValue = !value || value === ''\n\n\tif (!required && noValue) return true\n\n\tif (noValue) return false\n\n\tswitch (type) {\n\t\tcase 'email':\n\t\t\treturn isEmail(value)\n\t\tcase 'number':\n\t\t\treturn !isNaN(Number(value))\n\t\tcase 'tel':\n\t\t\treturn isPhoneNumber(value)\n\t\tdefault:\n\t\t\treturn true\n\t}\n}\n\nexport default function Input({\n\tchecked,\n\tclassName,\n\tdefaultValue,\n\tdescription,\n\tdescriptionProps,\n\tdisabled,\n\tfieldProps,\n\tinvalid = true,\n\tlabel,\n\tlabelProps,\n\tname,\n\tonBlur,\n\tonChange,\n\tplaceholder,\n\tref,\n\trequired = true,\n\ttype,\n\tvalue,\n\t...props\n}: InputProps) {\n\tconst [formContext, setFormContext] = useFormContext()\n\n\tif (placeholder === '*') placeholder = name + (required && !label ? '*' : '')\n\tif (label === '*') label = name\n\n\tconst uniqueID = useId(),\n\t\tfieldContextID = toLowerCase(name, [, '_']) + '§' + uniqueID\n\n\tif (Boolean(formContext?.find(field => field.id === fieldContextID)?.invalid)) invalid = true\n\n\tconst getFieldContextType = () => {\n\t\tswitch (type) {\n\t\t\tcase 'email':\n\t\t\t\treturn 'email'\n\t\t\tcase 'file':\n\t\t\t\treturn 'file'\n\t\t\tcase 'number':\n\t\t\t\treturn 'number'\n\t\t\tcase 'tel':\n\t\t\t\treturn 'tel'\n\t\t\tcase 'url':\n\t\t\t\treturn 'url'\n\t\t\tdefault:\n\t\t\t\treturn 'string'\n\t\t}\n\t}\n\n\tconst fieldContextType = getFieldContextType()\n\n\tconst initialFieldContext = defineField({\n\t\ttype: fieldContextType,\n\t\tid: fieldContextID,\n\t\tinvalid,\n\t\tname,\n\t\trequired,\n\t\tvalue: value ? `${value}` : defaultValue ? `${defaultValue}` : '',\n\t})\n\n\tuseEffect(() => {\n\t\tif (!setFormContext) return\n\n\t\tsetFormContext(prevContext => {\n\t\t\tconst otherFields = (prevContext || []).filter(field => field.id !== initialFieldContext.id)\n\n\t\t\treturn [...otherFields, initialFieldContext]\n\t\t})\n\n\t\treturn () => {\n\t\t\tsetFormContext(prevContext => (prevContext || []).filter(field => field.id !== initialFieldContext.id))\n\t\t}\n\t}, [setFormContext])\n\n\tconst fieldContext: FieldContext =\n\t\tformContext?.find(({ id: fieldID }) => fieldID === initialFieldContext.id) || initialFieldContext\n\n\tconst debounceTimerRef = useRef<NodeJS.Timeout>(undefined)\n\n\tconst handleChange: ChangeEventHandler<HTMLInputElement> = e => {\n\t\tif (disabled) {\n\t\t\te.preventDefault()\n\t\t\treturn\n\t\t}\n\n\t\tclearTimeout(debounceTimerRef.current)\n\n\t\tconst { currentTarget } = e,\n\t\t\t{ value: newValue } = currentTarget\n\n\t\tsetFormContext?.(prevContext => {\n\t\t\tif (!prevContext) return []\n\n\t\t\tconst field = prevContext.find(({ id: fieldID }) => fieldID === initialFieldContext.id)\n\n\t\t\tif (!field) throw new Error(`Field with id \"${initialFieldContext.id}\" not found in form context.`)\n\n\t\t\tconst otherFields = prevContext.filter(({ id: fieldID }) => fieldID !== initialFieldContext.id)\n\n\t\t\tconst updatedField = { ...field, value: newValue }\n\n\t\t\treturn [...otherFields, updatedField]\n\t\t})\n\n\t\tdebounceTimerRef.current = setTimeout(() => {\n\t\t\tconst field = formContext?.find(({ id: fieldID }) => fieldID === initialFieldContext.id)\n\n\t\t\tif (!field) return\n\n\t\t\tconst invalid = validateField(newValue, field) === false\n\n\t\t\tif (invalid !== field.invalid)\n\t\t\t\tsetFormContext?.(prevContext => {\n\t\t\t\t\tif (!prevContext) return []\n\n\t\t\t\t\tconst field = prevContext.find(({ id: fieldID }) => fieldID === initialFieldContext.id)\n\n\t\t\t\t\tif (!field) throw new Error(`Field with id \"${initialFieldContext.id}\" not found in form context.`)\n\n\t\t\t\t\tconst otherFields = prevContext.filter(({ id: fieldID }) => fieldID !== initialFieldContext.id)\n\n\t\t\t\t\tconst updatedField = { ...field, invalid }\n\n\t\t\t\t\treturn [...otherFields, updatedField]\n\t\t\t\t})\n\t\t}, 500)\n\n\t\tonChange?.(e)\n\t}\n\n\tconst handleBlur: FocusEventHandler<HTMLInputElement> = e => {\n\t\tif (disabled) {\n\t\t\te.preventDefault()\n\t\t\treturn\n\t\t}\n\n\t\tconst { currentTarget } = e,\n\t\t\t{ value: newValue } = currentTarget\n\n\t\tswitch (type) {\n\t\t\tcase 'email':\n\t\t\t\tsetFormContext?.(prevContext => {\n\t\t\t\t\tif (!prevContext) return []\n\n\t\t\t\t\tconst field = prevContext.find(({ id: fieldID }) => fieldID === initialFieldContext.id)\n\n\t\t\t\t\tif (!field) throw new Error(`Field with id \"${initialFieldContext.id}\" not found in form context.`)\n\n\t\t\t\t\tconst otherFields = prevContext.filter(({ id: fieldID }) => fieldID !== initialFieldContext.id)\n\n\t\t\t\t\tconst updatedField = { ...field, value: newValue.toLowerCase() }\n\n\t\t\t\t\treturn [...otherFields, updatedField]\n\t\t\t\t})\n\t\t\t\tbreak\n\t\t\tcase 'tel':\n\t\t\t\tsetFormContext?.(prevContext => {\n\t\t\t\t\tif (!prevContext) return []\n\n\t\t\t\t\tconst field = prevContext.find(({ id: fieldID }) => fieldID === initialFieldContext.id)\n\n\t\t\t\t\tif (!field) throw new Error(`Field with id \"${initialFieldContext.id}\" not found in form context.`)\n\n\t\t\t\t\tconst otherFields = prevContext.filter(({ id: fieldID }) => fieldID !== initialFieldContext.id)\n\n\t\t\t\t\tconst updatedField = { ...field, value: formatPhoneNumber(newValue, '1') }\n\n\t\t\t\t\treturn [...otherFields, updatedField]\n\t\t\t\t})\n\t\t\t\tbreak\n\t\t}\n\n\t\tonBlur?.(e)\n\t}\n\n\tconst restFieldProps: Omit<FieldProps, 'className' | 'disabled'> = fieldProps\n\t\t? Object.fromEntries(Object.entries(fieldProps).filter(([key]) => key !== 'className'))\n\t\t: {}\n\n\tconst restLabelProps: Omit<LabelProps, 'className' | 'children'> = labelProps\n\t\t? Object.fromEntries(Object.entries(labelProps).filter(([key]) => key !== 'className'))\n\t\t: {}\n\n\tconst restDescriptionProps: Omit<DescriptionProps, 'className' | 'children'> = descriptionProps\n\t\t? Object.fromEntries(Object.entries(descriptionProps).filter(([key]) => key !== 'className'))\n\t\t: {}\n\n\treturn (\n\t\t<Field\n\t\t\t{...restFieldProps}\n\t\t\tclassName={bag =>\n\t\t\t\ttwMerge(\n\t\t\t\t\t'grid gap-1',\n\t\t\t\t\ttypeof fieldProps?.className === 'function' ? fieldProps?.className(bag) : fieldProps?.className,\n\t\t\t\t)\n\t\t\t}\n\t\t\tdisabled={disabled}\n\t\t>\n\t\t\t{label && (\n\t\t\t\t<Label\n\t\t\t\t\t{...restLabelProps}\n\t\t\t\t\tclassName={bag =>\n\t\t\t\t\t\ttwMerge(\n\t\t\t\t\t\t\t'text-sm font-medium',\n\t\t\t\t\t\t\trequired ? 'after:text-ui-red after:content-[\"_*\"]' : '',\n\t\t\t\t\t\t\ttypeof labelProps?.className === 'function' ? labelProps?.className(bag) : labelProps?.className,\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t>\n\t\t\t\t\t{label}\n\t\t\t\t</Label>\n\t\t\t)}\n\n\t\t\t<HeadlessInput\n\t\t\t\t{...props}\n\t\t\t\tclassName={bag =>\n\t\t\t\t\ttwMerge(\n\t\t\t\t\t\t// Base styles\n\t\t\t\t\t\t'rounded-xl border-1 border-neutral-500/50 bg-neutral-100 py-1 pl-2 text-neutral-950 outline-offset-1 outline-ui-sky-blue/95 transition-[background-color] duration-300 ease-exponential dark:bg-neutral-700 dark:text-neutral-50',\n\t\t\t\t\t\t// Pseudo styles\n\t\t\t\t\t\t'focus-visible:bg-neutral-50 focus-visible:outline-3 active:bg-neutral-200 dark:focus-visible:bg-neutral-600 dark:active:bg-neutral-800 pointer-fine:hover:bg-neutral-50 pointer-fine:active:bg-neutral-200 dark:pointer-fine:hover:bg-neutral-600 dark:pointer-fine:active:bg-neutral-800',\n\t\t\t\t\t\t// user-invalid styles\n\t\t\t\t\t\t'user-invalid:border-ui-red user-invalid:bg-[color-mix(in_oklab,var(--color-ui-red)_20%,var(--color-neutral-100))] user-invalid:focus-visible:bg-[color-mix(in_oklab,var(--color-ui-red)_1%,var(--color-neutral-100))] user-invalid:active:bg-[color-mix(in_oklab,var(--color-ui-red)_25%,var(--color-neutral-100))] dark:user-invalid:bg-[color-mix(in_oklab,var(--color-ui-red)_20%,var(--color-neutral-800))] dark:user-invalid:focus-visible:bg-[color-mix(in_oklab,var(--color-ui-red)_1%,var(--color-neutral-800))] dark:user-invalid:active:bg-[color-mix(in_oklab,var(--color-ui-red)_25%,var(--color-neutral-800))] user-invalid:pointer-fine:hover:bg-[color-mix(in_oklab,var(--color-ui-red)_10%,var(--color-neutral-100))] user-invalid:pointer-fine:focus-visible:bg-[color-mix(in_oklab,var(--color-ui-red)_1%,var(--color-neutral-100))] user-invalid:pointer-fine:active:bg-[color-mix(in_oklab,var(--color-ui-red)_25%,var(--color-neutral-100))] dark:user-invalid:pointer-fine:hover:bg-[color-mix(in_oklab,var(--color-ui-red)_10%,var(--color-neutral-800))] dark:user-invalid:pointer-fine:focus-visible:bg-[color-mix(in_oklab,var(--color-ui-red)_1%,var(--color-neutral-800))] dark:user-invalid:pointer-fine:active:bg-[color-mix(in_oklab,var(--color-ui-red)_25%,var(--color-neutral-800))]',\n\t\t\t\t\t\t// Custom styles\n\t\t\t\t\t\ttypeof className === 'function' ? className(bag) : className,\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tid={fieldContext?.id}\n\t\t\t\tinvalid={invalid}\n\t\t\t\tonBlur={handleBlur}\n\t\t\t\tonChange={handleChange}\n\t\t\t\tplaceholder={placeholder}\n\t\t\t\tref={ref}\n\t\t\t\trequired={required}\n\t\t\t\ttype={type}\n\t\t\t\tvalue={fieldContext?.value}\n\t\t\t/>\n\n\t\t\t{description && (\n\t\t\t\t<Description\n\t\t\t\t\t{...restDescriptionProps}\n\t\t\t\t\tclassName={bag =>\n\t\t\t\t\t\ttwMerge(\n\t\t\t\t\t\t\t'text-xs',\n\t\t\t\t\t\t\ttypeof descriptionProps?.className === 'function'\n\t\t\t\t\t\t\t\t? descriptionProps?.className(bag)\n\t\t\t\t\t\t\t\t: descriptionProps?.className,\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t>\n\t\t\t\t\t{description}\n\t\t\t\t</Description>\n\t\t\t)}\n\t\t</Field>\n\t)\n}\n","// * Types\nimport { ReactNode } from 'react'\n\nexport type SubmitButtonProps = ButtonProps<HTMLButtonElement> & {\n\t/** The message to display when the form status is \"error\" */\n\terror?: ReactNode\n\t/** The message to display when the form status is \"incomplete\" */\n\tincomplete?: ReactNode\n\t/** The message to display when the form status is \"loading\" */\n\tloading?: ReactNode\n\t/** @deprecated Use `children` instead.\n\t *\n\t * ~~The message to display when the form status is \"ready\"~~\n\t */\n\tready?: never\n\t/** The message to display when the form status is \"success\" */\n\tsuccess?: ReactNode\n\t/** The message to display when the form status is \"readonly\" */\n\treadonly?: ReactNode\n}\n\n// * Hooks\nimport { useFormStatus } from '../../hooks'\n\n// * Components\nimport Button, { ButtonProps } from '../button'\n\n// * Utilities\nimport { twMerge, twSort } from '../../utils'\n\nexport default function SubmitButton({\n\tchildren,\n\tclassName,\n\terror,\n\tincomplete,\n\tloading,\n\tsuccess,\n\ttheme,\n\ttype = 'submit',\n\tref,\n\t...props\n}: SubmitButtonProps) {\n\tconst [formStatus] = useFormStatus()\n\n\tconst getFormStatusButtonClasses = () => {\n\t\tswitch (formStatus) {\n\t\t\tcase 'loading':\n\t\t\t\treturn twSort('animate-pulse cursor-wait text-lg leading-6 font-black tracking-widest')\n\t\t\tcase 'error':\n\t\t\tcase 'success':\n\t\t\t\treturn 'cursor-not-allowed'\n\t\t\tdefault:\n\t\t\t\treturn undefined\n\t\t}\n\t}\n\n\tconst formStatusButtonClasses = getFormStatusButtonClasses()\n\n\tconst getFormStatusButtonTheme = () => {\n\t\tswitch (formStatus) {\n\t\t\tcase 'incomplete':\n\t\t\t\treturn 'grey'\n\t\t\tcase 'loading':\n\t\t\t\treturn 'blue'\n\t\t\tcase 'error':\n\t\t\t\treturn 'red'\n\t\t\tcase 'success':\n\t\t\t\treturn 'green'\n\t\t\tdefault:\n\t\t\t\treturn theme\n\t\t}\n\t}\n\n\tconst formStatusButtonTheme = getFormStatusButtonTheme()\n\n\tconst getButtonText = () => {\n\t\tswitch (formStatus) {\n\t\t\tcase 'incomplete':\n\t\t\t\treturn incomplete || 'Complete Form'\n\t\t\tcase 'loading':\n\t\t\t\treturn (\n\t\t\t\t\tloading || (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<span className='inline-block animate-wave animation-delay-300'>•</span>\n\t\t\t\t\t\t\t<span className='inline-block animate-wave animation-delay-150'>•</span>\n\t\t\t\t\t\t\t<span className='inline-block animate-wave'>•</span>\n\t\t\t\t\t\t</>\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\tcase 'error':\n\t\t\t\treturn (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{error || 'Error'}{' '}\n\t\t\t\t\t\t<span className='absolute top-1/2 ml-1.5 translate-y-[calc(-50%-1.5px)] text-2xl'>×</span>\n\t\t\t\t\t</>\n\t\t\t\t)\n\t\t\tcase 'success':\n\t\t\t\treturn success || 'Successfully Submitted'\n\t\t\tdefault:\n\t\t\t\treturn children || 'Submit'\n\t\t}\n\t}\n\n\tconst buttonText = getButtonText()\n\n\treturn (\n\t\t<Button<HTMLButtonElement>\n\t\t\t{...props}\n\t\t\tclassName={twMerge([formStatusButtonClasses, 'w-full', className])}\n\t\t\tref={ref}\n\t\t\ttheme={formStatusButtonTheme}\n\t\t\ttype={type}\n\t\t>\n\t\t\t{buttonText}\n\t\t</Button>\n\t)\n}\n","// * Types\nimport { ChangeEventHandler, ReactNode, RefObject, useEffect, useId, useRef } from 'react'\n\nexport type TextareaProps = Omit<HeadlessTextareaProps, 'name'> & {\n\tdescription?: ReactNode\n\tdescriptionProps?: Omit<DescriptionProps, 'children'> & {\n\t\t/** @deprecated Use the `description` prop instead. */\n\t\tchildren?: never\n\t}\n\tfieldProps?: Omit<FieldProps, 'children' | 'disabled'>\n\tlabel?: ReactNode\n\tlabelProps?: Omit<LabelProps, 'children'> & {\n\t\t/** @deprecated Use the `label` prop instead. */\n\t\tchildren?: never\n\t}\n\tname: string\n\tref?: RefObject<HTMLTextAreaElement | null>\n}\n\n// * Hooks\nimport { defineField, Field as FieldContext, useFormContext } from '../../hooks'\n\n// * Headless UI\nimport {\n\tDescription,\n\tDescriptionProps,\n\tField,\n\tFieldProps,\n\tTextarea as HeadlessTextarea,\n\tTextareaProps as HeadlessTextareaProps,\n\tLabel,\n\tLabelProps,\n} from '@headlessui/react'\n\n// * Utilities\nimport { toLowerCase, twMerge } from '../../utils'\n\nfunction validateField(value: string, { required }: FieldContext) {\n\tconst noValue = !value || value === ''\n\n\tif (!required && noValue) return true\n\n\tif (noValue) return false\n\n\treturn true\n}\n\nexport default function Textarea({\n\tclassName,\n\tdefaultValue,\n\tdescription,\n\tdescriptionProps,\n\tdisabled,\n\tfieldProps,\n\tinvalid = true,\n\tlabel,\n\tlabelProps,\n\tname,\n\tonBlur,\n\tonChange,\n\tplaceholder,\n\tref,\n\trequired = true,\n\tvalue,\n\t...props\n}: TextareaProps) {\n\tconst [formContext, setFormContext] = useFormContext()\n\n\tif (placeholder === '*') placeholder = name + (required && !label ? '*' : '')\n\tif (label === '*') label = name\n\n\tconst uniqueID = useId(),\n\t\tfieldContextID = toLowerCase(name, [, '_']) + '§' + uniqueID\n\n\tif (Boolean(formContext?.find(field => field.id === fieldContextID)?.invalid)) invalid = true\n\n\tconst initialFieldContext = defineField({\n\t\ttype: 'textarea',\n\t\tid: fieldContextID,\n\t\tinvalid,\n\t\tname,\n\t\trequired,\n\t\tvalue: value ? `${value}` : defaultValue ? `${defaultValue}` : '',\n\t})\n\n\tuseEffect(() => {\n\t\tif (!setFormContext) return\n\n\t\tsetFormContext(prevContext => {\n\t\t\tconst otherFields = (prevContext || []).filter(field => field.id !== initialFieldContext.id)\n\n\t\t\treturn [...otherFields, initialFieldContext]\n\t\t})\n\n\t\treturn () => {\n\t\t\tsetFormContext(prevContext => (prevContext || []).filter(field => field.id !== initialFieldContext.id))\n\t\t}\n\t}, [setFormContext])\n\n\tconst fieldContext: FieldContext =\n\t\tformContext?.find(({ id: fieldID }) => fieldID === initialFieldContext.id) || initialFieldContext\n\n\tconst debounceTimerRef = useRef<NodeJS.Timeout>(undefined)\n\n\tconst handleChange: ChangeEventHandler<HTMLTextAreaElement> = e => {\n\t\tif (disabled) {\n\t\t\te.preventDefault()\n\t\t\treturn\n\t\t}\n\n\t\tclearTimeout(debounceTimerRef.current)\n\n\t\tconst { currentTarget } = e,\n\t\t\t{ value: newValue } = currentTarget\n\n\t\tsetFormContext?.(prevContext => {\n\t\t\tif (!prevContext) return []\n\n\t\t\tconst field = prevContext.find(({ id: fieldID }) => fieldID === initialFieldContext.id)\n\n\t\t\tif (!field) throw new Error(`Field with id \"${initialFieldContext.id}\" not found in form context.`)\n\n\t\t\tconst otherFields = prevContext.filter(({ id: fieldID }) => fieldID !== initialFieldContext.id)\n\n\t\t\tconst updatedField = { ...field, value: newValue }\n\n\t\t\treturn [...otherFields, updatedField]\n\t\t})\n\n\t\tdebounceTimerRef.current = setTimeout(() => {\n\t\t\tconst field = formContext?.find(({ id: fieldID }) => fieldID === initialFieldContext.id)\n\n\t\t\tif (!field) return\n\n\t\t\tconst invalid = validateField(newValue, field) === false\n\n\t\t\tif (invalid !== field.invalid)\n\t\t\t\tsetFormContext?.(prevContext => {\n\t\t\t\t\tif (!prevContext) return []\n\n\t\t\t\t\tconst field = prevContext.find(({ id: fieldID }) => fieldID === initialFieldContext.id)\n\n\t\t\t\t\tif (!field) throw new Error(`Field with id \"${initialFieldContext.id}\" not found in form context.`)\n\n\t\t\t\t\tconst otherFields = prevContext.filter(({ id: fieldID }) => fieldID !== initialFieldContext.id)\n\n\t\t\t\t\tconst updatedField = { ...field, invalid }\n\n\t\t\t\t\treturn [...otherFields, updatedField]\n\t\t\t\t})\n\t\t}, 500)\n\n\t\tonChange?.(e)\n\t}\n\n\tconst restFieldProps: Omit<FieldProps, 'className' | 'disabled'> = fieldProps\n\t\t? Object.fromEntries(Object.entries(fieldProps).filter(([key]) => key !== 'className'))\n\t\t: {}\n\n\tconst restLabelProps: Omit<LabelProps, 'className' | 'children'> = labelProps\n\t\t? Object.fromEntries(Object.entries(labelProps).filter(([key]) => key !== 'className'))\n\t\t: {}\n\n\tconst restDescriptionProps: Omit<DescriptionProps, 'className' | 'children'> = descriptionProps\n\t\t? Object.fromEntries(Object.entries(descriptionProps).filter(([key]) => key !== 'className'))\n\t\t: {}\n\n\treturn (\n\t\t<Field\n\t\t\t{...restFieldProps}\n\t\t\tclassName={bag =>\n\t\t\t\ttwMerge(\n\t\t\t\t\t'grid gap-1',\n\t\t\t\t\ttypeof fieldProps?.className === 'function' ? fieldProps?.className(bag) : fieldProps?.className,\n\t\t\t\t)\n\t\t\t}\n\t\t\tdisabled={disabled}\n\t\t>\n\t\t\t{label && (\n\t\t\t\t<Label\n\t\t\t\t\t{...restLabelProps}\n\t\t\t\t\tclassName={bag =>\n\t\t\t\t\t\ttwMerge(\n\t\t\t\t\t\t\t'text-sm font-medium',\n\t\t\t\t\t\t\trequired ? 'after:text-ui-red after:content-[\"_*\"]' : '',\n\t\t\t\t\t\t\ttypeof labelProps?.className === 'function' ? labelProps?.className(bag) : labelProps?.className,\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t>\n\t\t\t\t\t{label}\n\t\t\t\t</Label>\n\t\t\t)}\n\n\t\t\t<HeadlessTextarea\n\t\t\t\t{...props}\n\t\t\t\tclassName={bag =>\n\t\t\t\t\ttwMerge(\n\t\t\t\t\t\t// Base styles\n\t\t\t\t\t\t'field-sizing-content resize-none rounded-xl border-1 border-neutral-500/50 bg-neutral-100 py-1 pl-2 text-neutral-950 outline-offset-1 outline-ui-sky-blue/95 transition-[background-color] duration-300 ease-exponential dark:bg-neutral-700 dark:text-neutral-50',\n\t\t\t\t\t\t// Pseudo styles\n\t\t\t\t\t\t'focus-visible:bg-neutral-50 focus-visible:outline-3 active:bg-neutral-200 dark:focus-visible:bg-neutral-600 dark:active:bg-neutral-800 pointer-fine:hover:bg-neutral-50 pointer-fine:active:bg-neutral-200 dark:pointer-fine:hover:bg-neutral-600 dark:pointer-fine:active:bg-neutral-800',\n\t\t\t\t\t\t// user-invalid styles\n\t\t\t\t\t\t'user-invalid:border-ui-red user-invalid:bg-[color-mix(in_oklab,var(--color-ui-red)_20%,var(--color-neutral-100))] user-invalid:focus-visible:bg-[color-mix(in_oklab,var(--color-ui-red)_1%,var(--color-neutral-100))] user-invalid:active:bg-[color-mix(in_oklab,var(--color-ui-red)_25%,var(--color-neutral-100))] dark:user-invalid:bg-[color-mix(in_oklab,var(--color-ui-red)_20%,var(--color-neutral-800))] dark:user-invalid:focus-visible:bg-[color-mix(in_oklab,var(--color-ui-red)_1%,var(--color-neutral-800))] dark:user-invalid:active:bg-[color-mix(in_oklab,var(--color-ui-red)_25%,var(--color-neutral-800))] user-invalid:pointer-fine:hover:bg-[color-mix(in_oklab,var(--color-ui-red)_10%,var(--color-neutral-100))] user-invalid:pointer-fine:focus-visible:bg-[color-mix(in_oklab,var(--color-ui-red)_1%,var(--color-neutral-100))] user-invalid:pointer-fine:active:bg-[color-mix(in_oklab,var(--color-ui-red)_25%,var(--color-neutral-100))] dark:user-invalid:pointer-fine:hover:bg-[color-mix(in_oklab,var(--color-ui-red)_10%,var(--color-neutral-800))] dark:user-invalid:pointer-fine:focus-visible:bg-[color-mix(in_oklab,var(--color-ui-red)_1%,var(--color-neutral-800))] dark:user-invalid:pointer-fine:active:bg-[color-mix(in_oklab,var(--color-ui-red)_25%,var(--color-neutral-800))]',\n\t\t\t\t\t\t// Custom styles\n\t\t\t\t\t\ttypeof className === 'function' ? className(bag) : className,\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tid={fieldContext?.id}\n\t\t\t\tinvalid={invalid}\n\t\t\t\tonChange={handleChange}\n\t\t\t\tplaceholder={placeholder}\n\t\t\t\tref={ref}\n\t\t\t\trequired={required}\n\t\t\t\tvalue={fieldContext?.value}\n\t\t\t/>\n\n\t\t\t{description && (\n\t\t\t\t<Description\n\t\t\t\t\t{...restDescriptionProps}\n\t\t\t\t\tclassName={bag =>\n\t\t\t\t\t\ttwMerge(\n\t\t\t\t\t\t\t'text-xs',\n\t\t\t\t\t\t\ttypeof descriptionProps?.className === 'function'\n\t\t\t\t\t\t\t\t? descriptionProps?.className(bag)\n\t\t\t\t\t\t\t\t: descriptionProps?.className,\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t>\n\t\t\t\t\t{description}\n\t\t\t\t</Description>\n\t\t\t)}\n\t\t</Field>\n\t)\n}\n","// * Types\nimport { ElementType, FormEvent, FormEventHandler, Fragment, useEffect } from 'react'\nimport { AnyElementProps } from '../../types'\n\nexport type FormSubmitArgs = {\n\tevent: FormEvent<HTMLFormElement>\n\tformContext: FormContext\n}\n\nexport type FormProps<T extends ElementType = 'form'> = Omit<\n\tAnyElementProps<\n\t\tT,\n\t\t{\n\t\t\tcontrolled?: 'auto' | 'manual' | 'none'\n\t\t\thandleSubmit?: FormEventHandler<HTMLFormElement>\n\t\t\tinitialStatus?: FormStatus\n\t\t\tonError?: (e: FormEvent<HTMLFormElement>, error: string) => void\n\t\t\tonSuccess?: (e: FormEvent<HTMLFormElement>) => void\n\t\t}\n\t>,\n\t'onSubmit'\n> & {\n\tonSubmit?: ({\n\t\tevent,\n\t\tformContext,\n\t}: FormSubmitArgs) =>\n\t\t| ({ error?: string; status?: 'error' } | { status?: 'success' })\n\t\t| Promise<{ error?: string; status?: 'error' } | { status?: 'success' }>\n}\n\n// * Form Status\nimport {\n\tFormContext,\n\tFormContextProvider,\n\tFormStatus,\n\tFormStatusProvider,\n\tuseFormContext,\n\tuseFormStatus,\n} from '../../hooks'\n\n// * Utilities\nimport { twMerge } from '../../utils'\n// import { findComponentByType } from '../../utils'\n\nfunction FormComponent<T extends ElementType = 'form'>({\n\tas,\n\tchildren,\n\tclassName,\n\thandleSubmit,\n\tonError,\n\tonSubmit,\n\tonSuccess,\n\t...props\n}: Omit<FormProps<T>, 'controlled' | 'initialStatus'>) {\n\tconst [formContext] = useFormContext(),\n\t\t[formStatus, setFormStatus] = useFormStatus()\n\n\t// const submitButton = findComponentByType(children, SubmitButton)\n\n\tuseEffect(() => {\n\t\tif (!formContext) return\n\n\t\tif (formStatus !== 'incomplete' && formContext.find(({ invalid }) => invalid)) setFormStatus?.('incomplete')\n\n\t\tif (formStatus !== 'ready' && formContext.every(({ invalid }) => !invalid)) setFormStatus?.('ready')\n\t}, [formContext])\n\n\tconst processSubmit: FormEventHandler<HTMLFormElement> =\n\t\thandleSubmit ||\n\t\t(async e => {\n\t\t\te.preventDefault()\n\t\t\te.stopPropagation()\n\n\t\t\tsetFormStatus?.('loading')\n\n\t\t\tconst response = await onSubmit?.({ event: e, formContext })\n\n\t\t\tif (response && ('error' in response || response.status === 'error')) {\n\t\t\t\tsetFormStatus?.('error')\n\t\t\t\tonError?.({ event: e, error: response.error || 'An error occurred when submitting the form.' })\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tif ((response && response.status === 'success') || !response) {\n\t\t\t\tsetFormStatus?.('success')\n\t\t\t\tonSuccess?.({ event: e })\n\t\t\t}\n\t\t})\n\n\tconst FormElement = (as as ElementType) || 'form'\n\n\treturn (\n\t\t<FormElement {...props} className={twMerge(className, 'grid gap-3')} onSubmit={processSubmit}>\n\t\t\t{children}\n\t\t</FormElement>\n\t)\n}\n\nexport default function Form<T extends ElementType = 'form'>({\n\tcontrolled = 'auto',\n\tinitialStatus = 'incomplete',\n\t...props\n}: FormProps<T>) {\n\tconst FormContextOrNotProvider = controlled === 'auto' ? FormContextProvider : Fragment\n\n\treturn (\n\t\t<FormStatusProvider initialStatus={initialStatus}>\n\t\t\t<FormContextOrNotProvider>\n\t\t\t\t<FormComponent {...props} />\n\t\t\t</FormContextOrNotProvider>\n\t\t</FormStatusProvider>\n\t)\n}\n\nimport Input, { InputProps } from './input'\nimport SubmitButton, { SubmitButtonProps } from './submit-button'\nimport Textarea, { TextareaProps } from './textarea'\n\nexport { Input, InputProps, Textarea, TextareaProps, SubmitButton, SubmitButtonProps }\n","// * Types\nimport { HTMLAttributes } from 'react'\n\ntype GhostProps = HTMLAttributes<HTMLDivElement>\n\n// * Utilities\nimport { twMerge } from '../utils'\n\nexport default function Ghost({ children, className, ...props }: GhostProps) {\n\treturn (\n\t\t<div {...props} className={twMerge('block w-24 max-w-full animate-pulse rounded bg-white/50', className)}>\n\t\t\t{children || <> </>}\n\t\t</div>\n\t)\n}\n","// * Types\nexport type HeadingProps = HTMLAttributes<HTMLHeadingElement> & {\n\tas?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'\n\tcustomize?: Partial<{\n\t\th1: string\n\t\th2: string\n\t\th3: string\n\t\th4: string\n\t\th5: string\n\t\th6: string\n\t}>\n\tref?: RefObject<HTMLHeadingElement | null>\n}\n\n// * React\nimport { Children, HTMLAttributes, ReactNode, RefObject, isValidElement } from 'react'\n\n// * Utilities\nimport { twMerge, twSort } from '../utils'\n\nfunction getTextFromChildren(children: ReactNode) {\n\tlet text = ''\n\n\tChildren.forEach(children, child => {\n\t\tif (typeof child === 'string' || typeof child === 'number') {\n\t\t\ttext += child\n\t\t} else if (isValidElement(child)) {\n\t\t\ttext += getTextFromChildren((child.props as { [key: string]: any }).children)\n\t\t}\n\t})\n\n\treturn text\n}\n\n/**\n * # Heading\n * A heading component that renders HTML heading elements (h1-h6) with appropriate styling.\n * Automatically generates an ID for the heading based on its content if none is provided.\n */\nexport default function Heading({ as = 'h2', children, customize, className, id, ref, ...props }: HeadingProps) {\n\tconst H = as\n\n\tconst targetableID = id || getTextFromChildren(children).replace(/\\s+/g, '-').toLowerCase()\n\n\tconst getBaseClasses = () => {\n\t\tswitch (as) {\n\t\t\tcase 'h1':\n\t\t\t\treturn customize?.h1 || twSort('pb-2.5 text-6xl font-black last:pb-0')\n\t\t\tcase 'h3':\n\t\t\t\treturn customize?.h3 || twSort('pb-2 text-4xl font-extralight last:pb-0')\n\t\t\tcase 'h4':\n\t\t\t\treturn customize?.h4 || twSort('pb-2 text-3xl font-extrabold last:pb-0')\n\t\t\tcase 'h5':\n\t\t\t\treturn customize?.h5 || twSort('pb-1.5 text-2xl font-semibold last:pb-0')\n\t\t\tcase 'h6':\n\t\t\t\treturn customize?.h6 || twSort('pb-1 text-xl font-bold last:pb-0')\n\t\t\tdefault:\n\t\t\t\treturn customize?.h2 || twSort('pb-2.5 text-5xl font-medium last:pb-0')\n\t\t}\n\t}\n\n\tconst baseClasses = getBaseClasses()\n\n\treturn (\n\t\t<H ref={ref} id={targetableID} {...props} className={twMerge(baseClasses, className)}>\n\t\t\t{children}\n\t\t</H>\n\t)\n}\n","import { SVGProps } from 'react'\n\nexport default function xmark(props: SVGProps<SVGSVGElement>) {\n return (\n <svg viewBox='0 0 64 64' {...props}>\n <path d='M1,63c0.7,0.7,1.6,1,2.6,1s1.9-0.3,2.6-1L32,37.1L57.8,63c0.7,0.7,1.5,1,2.5,1c1,0,1.9-0.3,2.6-1c0.7-0.7,1-1.6,1-2.6 c0-1-0.3-1.8-1-2.5L37.1,32L63,6.2c0.7-0.7,1-1.6,1-2.6S63.7,1.7,63,1c-0.7-0.7-1.6-1-2.6-1c-1,0-1.8,0.3-2.5,1L32,26.9L6.2,1 C5.5,0.3,4.6,0,3.6,0C2.6,0,1.7,0.3,1,1C0.3,1.7,0,2.6,0,3.6c0,1,0.3,1.9,1,2.6L26.9,32L1,57.8c-0.7,0.7-1,1.5-1,2.6 C0,61.4,0.3,62.3,1,63z' />\n </svg>\n )\n}\n","// * Types\nimport { AnyElementProps } from '../types'\n\nexport type ModalProps = Omit<HTMLAttributes<HTMLDivElement>, 'children'> & {\n\tchildren: ReactNode | (({ openModal, closeModal }: { openModal: () => void; closeModal: () => void }) => ReactNode)\n\tcloseButtonRef?: RefObject<HTMLButtonElement | null>\n\tdragToClose?: boolean\n\tonClose?: () => void\n\tonOpen?: () => void\n\tplace?: 'center' | 'bottom'\n}\n\n// * React\nimport {\n\tcloneElement,\n\tElementType,\n\tHTMLAttributes,\n\tMouseEventHandler,\n\tReactElement,\n\tReactNode,\n\tRefObject,\n\tTouchEventHandler,\n\tuseEffect,\n\tuseRef,\n\tuseState,\n} from 'react'\nimport { createPortal } from 'react-dom'\n\n// * Components\nimport {\n\tButton as HeadlessButton,\n\tDialog,\n\tDialogPanel,\n\tDialogTitle,\n\tDialogBackdrop,\n\tDialogTitleProps,\n} from '@headlessui/react'\nimport Button from './button'\nimport { Xmark } from '../icons'\n\n// * Utilities\nimport { easeOutExpo, findComponentByType, twMerge } from '../utils'\n\nexport function ModalTrigger<T extends ElementType = typeof HeadlessButton>({ as, ...props }: AnyElementProps<T>) {\n\tconst Element = as || HeadlessButton\n\n\treturn <Element {...props} />\n}\n\nexport function ModalTitle(props: DialogTitleProps) {\n\treturn <DialogTitle {...props} />\n}\n\nexport function ModalDialog(props: HTMLAttributes<HTMLDivElement>) {\n\treturn <div {...props} />\n}\n\nexport function ModalClose<T extends ElementType = typeof HeadlessButton>({ as, ...props }: AnyElementProps<T>) {\n\tconst Element = as || HeadlessButton\n\n\treturn <Element {...props} />\n}\n\nexport default function Modal({ children, className, onClose, onOpen, place = 'bottom' }: ModalProps) {\n\tconst [bodyElement, setBodyElement] = useState<HTMLBodyElement | null>(null)\n\n\tuseEffect(() => {\n\t\tif (!bodyElement && typeof window !== 'undefined') setBodyElement(document.body as HTMLBodyElement)\n\t}, [bodyElement])\n\n\tconst [isOpen, setIsOpen] = useState(false)\n\n\tconst dialogPanelRef = useRef<HTMLElement>(null),\n\t\tdragMoveBoxRef = useRef<HTMLDivElement>(null),\n\t\t// lastTouchYRef = useRef(0),\n\t\tstartDragCoords = useRef({ x: 0, y: 0 })\n\n\tconst [allowDragClose, setAllowDragClose] = useState(false),\n\t\t[readyToClose, setReadyToClose] = useState(false)\n\n\tconst openModal = () => {\n\t\tconsole.log('open')\n\t\tsetIsOpen(true)\n\t\tonOpen?.()\n\t}\n\n\tconst closeModal = () => {\n\t\tconsole.log('close')\n\t\tsetIsOpen(false)\n\t\tonClose?.()\n\t}\n\n\tconst enableClose = (clientX: number, clientY: number) => {\n\t\tstartDragCoords.current.x = clientX\n\t\tstartDragCoords.current.y = clientY\n\t\tdialogPanelRef.current!.style.transitionDuration = '0s'\n\n\t\tsetAllowDragClose(true)\n\t}\n\n\tconst enableTouchClose: TouchEventHandler<HTMLButtonElement> = e => {\n\t\tconst { touches } = e,\n\t\t\ttouch = touches[0],\n\t\t\t{ clientY } = touch\n\n\t\tenableClose(0, clientY)\n\t}\n\n\tconst enableMouseClose: MouseEventHandler<HTMLButtonElement> = e => {\n\t\tconst { clientX, clientY } = e\n\n\t\tenableClose(clientX, clientY)\n\t}\n\n\tconst handleMove = (clientX: number, clientY: number) => {\n\t\tif (!dialogPanelRef.current) return\n\n\t\tlet deltaX = clientX - startDragCoords.current.x,\n\t\t\tdeltaY = clientY - startDragCoords.current.y\n\n\t\tif (deltaX > 0) deltaX = easeOutExpo(Math.abs(deltaX), 0, 25, 5000)\n\t\tif (deltaX < 0) deltaX = -easeOutExpo(Math.abs(deltaX), 0, 25, 5000)\n\t\tif (deltaY < 0) deltaY = -easeOutExpo(Math.abs(deltaY), 0, 25, 2000)\n\n\t\tif (deltaY >= 100 && !readyToClose) {\n\t\t\tsetReadyToClose(true)\n\t\t} else if (deltaY < 100 && readyToClose) {\n\t\t\tsetReadyToClose(false)\n\t\t}\n\n\t\tconst greaterThanMediaSmall = innerWidth > 640\n\n\t\tdialogPanelRef.current.style.translate = `calc(-50% + ${deltaX}px) ${greaterThanMediaSmall ? `calc(-50% + ${deltaY}px)` : `${deltaY}px`}`\n\t}\n\n\tconst handleMouseMove: MouseEventHandler<HTMLDivElement> = e => {\n\t\tif (!allowDragClose) return\n\n\t\tconst { clientX, clientY } = e\n\n\t\thandleMove(clientX, clientY)\n\t}\n\n\tconst disableDragClose = (clientY: number) => {\n\t\tconst deltaY = clientY - startDragCoords.current.y\n\n\t\tdialogPanelRef.current!.style.transitionDuration = ''\n\n\t\tif (deltaY >= 100) {\n\t\t\tcloseModal()\n\t\t\tsetReadyToClose(false)\n\t\t} else {\n\t\t\tsetTimeout(() => (dialogPanelRef.current!.style.removeProperty('translate'), 50))\n\t\t}\n\t}\n\n\tconst disableMouseDragClose: MouseEventHandler<HTMLDivElement> = e => {\n\t\tif (allowDragClose) setAllowDragClose(false)\n\n\t\tconst { clientY } = e\n\n\t\tdisableDragClose(clientY)\n\t}\n\n\tconst content = typeof children === 'function' ? children({ openModal, closeModal }) : children\n\n\tconst dialogElement = findComponentByType(content, ModalDialog)\n\n\tif (!dialogElement) throw new Error('ModalDialog must be defined in Modal children')\n\n\tlet triggerElement: ReactElement | null = null\n\n\tif (typeof children !== 'function') {\n\t\ttriggerElement = findComponentByType(content, ModalTrigger)\n\n\t\tif (!triggerElement) throw new Error('ModalTrigger must be provided when not using render prop pattern')\n\t} else {\n\t\ttriggerElement = findComponentByType(content, ModalTrigger)\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{allowDragClose &&\n\t\t\t\tbodyElement &&\n\t\t\t\tcreatePortal(\n\t\t\t\t\t<div\n\t\t\t\t\t\tref={dragMoveBoxRef}\n\t\t\t\t\t\tclassName='z-99 pointer-coarse:hidden fixed inset-0 h-dvh w-screen bg-transparent active:cursor-grabbing'\n\t\t\t\t\t\tonMouseMove={handleMouseMove}\n\t\t\t\t\t\tonMouseUp={disableMouseDragClose}\n\t\t\t\t\t></div>,\n\t\t\t\t\tbodyElement,\n\t\t\t\t)}\n\n\t\t\t{triggerElement &&\n\t\t\t\tcloneElement(triggerElement as ReactElement<HTMLAttributes<HTMLButtonElement>>, { onClick: openModal })}\n\n\t\t\t<Dialog\n\t\t\t\topen={isOpen}\n\t\t\t\tonClose={closeModal}\n\t\t\t\tclassName={[\n\t\t\t\t\t'isolate z-50',\n\t\t\t\t\tplace === 'bottom' &&\n\t\t\t\t\t\t'after:fixed after:inset-x-0 after:bottom-0 after:-z-10 after:h-16 after:bg-neutral-50 sm:after:hidden',\n\t\t\t\t].join(' ')}\n\t\t\t>\n\t\t\t\t<DialogBackdrop\n\t\t\t\t\ttransition\n\t\t\t\t\tclassName={[\n\t\t\t\t\t\t'duration-750 ease-exponential data-closed:opacity-0 fixed inset-0 cursor-pointer transition-[opacity_background-color_backdrop-filter_-webkit-backdrop-filter] delay-100',\n\t\t\t\t\t\treadyToClose\n\t\t\t\t\t\t\t? 'bg-neutral-50/5 backdrop-blur-[1px] dark:bg-neutral-950/5'\n\t\t\t\t\t\t\t: 'bg-neutral-50/25 backdrop-blur-sm dark:bg-neutral-950/25',\n\t\t\t\t\t].join(' ')}\n\t\t\t\t>\n\t\t\t\t\t<Button\n\t\t\t\t\t\ttheme='blue'\n\t\t\t\t\t\tpadding='none'\n\t\t\t\t\t\trounded='full'\n\t\t\t\t\t\tclassName='group/button pointer-fine:hover:w-20 fixed right-4 top-4 h-7 w-7 overflow-x-hidden transition-[scale_width_filter]'\n\t\t\t\t\t>\n\t\t\t\t\t\t<div className='pointer-fine:group-hover/button:-translate-x-0.5 ease-exponential absolute right-1 top-1 flex items-center gap-1 pt-px transition-transform duration-300'>\n\t\t\t\t\t\t\t<span className='block text-xs font-medium uppercase leading-none text-neutral-50'>\n\t\t\t\t\t\t\t\tClose<span className='sr-only'> Modal</span>\n\t\t\t\t\t\t\t</span>\n\n\t\t\t\t\t\t\t<Xmark className='-top-px block size-5 rotate-90 scale-75 fill-white stroke-white stroke-1 transition-transform duration-300 ease-in-out group-hover/button:rotate-0' />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</Button>\n\t\t\t\t</DialogBackdrop>\n\n\t\t\t\t<DialogPanel\n\t\t\t\t\tref={dialogPanelRef}\n\t\t\t\t\ttransition\n\t\t\t\t\tclassName={twMerge(\n\t\t\t\t\t\t'duration-750 ease-exponential data-closed:opacity-0 data-closed:scale-50 fixed left-1/2 -translate-x-1/2 overflow-y-scroll bg-neutral-50 p-4 shadow-[0_-15px_50px_-12px] shadow-neutral-950/25 transition-[transform_translate_opacity] sm:w-[calc(100vw-2rem)] sm:max-w-fit sm:p-6 sm:shadow-2xl lg:p-8 dark:bg-neutral-900',\n\t\t\t\t\t\tplace === 'center'\n\t\t\t\t\t\t\t? 'data-enter:translate-y-[calc(-50%+12rem)] data-leave:translate-y-[calc(-50%-8rem)] top-1/2 -translate-y-1/2 rounded-2xl'\n\t\t\t\t\t\t\t: 'rounded-t-4xl pointer-fine:top-1/2 pointer-fine:bottom-auto pointer-fine:-translate-y-1/2 pointer-fine:rounded-2xl data-enter:translate-y-full sm:data-enter:translate-y-[calc(-50%+12rem)] data-leave:translate-y-full sm:data-leave:translate-y-[calc(-50%-8rem)] sm:data-open:-translate-y-1/2 bottom-0 h-fit max-h-[calc(100dvh-4rem)] translate-y-0 sm:bottom-auto sm:top-1/2 sm:rounded-b-2xl sm:rounded-t-2xl',\n\t\t\t\t\t\tclassName,\n\t\t\t\t\t)}\n\t\t\t\t\t// onTouchStart={dragToClose ? handleTouchStart : undefined}\n\t\t\t\t\t// onTouchMove={handleTouchMove}\n\t\t\t\t\t// onTouchEnd={disableTouchDragClose}\n\t\t\t\t>\n\t\t\t\t\t<button\n\t\t\t\t\t\tonTouchStart={enableTouchClose}\n\t\t\t\t\t\tonMouseDown={enableMouseClose}\n\t\t\t\t\t\tclassName={[\n\t\t\t\t\t\t\t'after:ease-exponential absolute inset-x-0 top-0 z-10 flex h-6 cursor-grab items-center justify-center after:h-1 after:w-8 after:rounded-full after:transition-[transform_background-color] after:duration-500 active:cursor-grabbing',\n\t\t\t\t\t\t\treadyToClose\n\t\t\t\t\t\t\t\t? 'after:scale-x-200 after:scale-y-200 after:bg-ui-blue'\n\t\t\t\t\t\t\t\t: 'after:bg-ui-grey/50 active:after:bg-ui-grey pointer-fine:hover:after:scale-x-125 pointer-fine:hover:after:bg-neutral-500/75 pointer-fine:active:after:scale-x-150 pointer-fine:active:after:bg-ui-grey active:after:scale-x-150 active:after:scale-y-125',\n\t\t\t\t\t\t].join(' ')}\n\t\t\t\t\t>\n\t\t\t\t\t\t<span className='sr-only'>Drag down to close</span>\n\t\t\t\t\t</button>\n\n\t\t\t\t\t{dialogElement}\n\t\t\t\t</DialogPanel>\n\t\t\t</Dialog>\n\t\t</>\n\t)\n}\n","// * Types\ntype TimeProps = HTMLAttributes<HTMLTimeElement> &\n\tPartial<{\n\t\tdateObject: Date\n\t\tdateTime: string\n\t\tday: boolean\n\t\thours: boolean\n\t\tmilliseconds: boolean\n\t\tminutes: boolean\n\t\tmonth: boolean\n\t\tseconds: boolean\n\t\tyear: boolean\n\t}> & { ref?: RefObject<HTMLTimeElement | null> }\n\n// * React\nimport { HTMLAttributes, RefObject, useEffect, useState } from 'react'\n\n// * Utilities\nimport { getDate, getHours, getMilliseconds, getMinutes, getMonth, getMonthName, getSeconds } from '../utils'\n\nexport default function Time({\n\tchildren,\n\tdateObject,\n\tdateTime,\n\tday,\n\thours,\n\tmilliseconds,\n\tminutes,\n\tmonth,\n\tseconds,\n\tyear,\n\tref,\n\t...props\n}: TimeProps) {\n\tconst [date, setDate] = useState<Date | undefined>(dateObject || undefined)\n\n\tconst getDateAndTime = () => {\n\t\tif (dateTime) return dateTime\n\n\t\tif (!date) return ''\n\n\t\tconst currentYear = date.getFullYear(),\n\t\t\tcurrentMonth = getMonth(date),\n\t\t\tcurrentDay = getDate(date),\n\t\t\tcurrentHour = getHours(date),\n\t\t\tcurrentMinute = getMinutes(date),\n\t\t\tcurrentSecond = getSeconds(date),\n\t\t\tcurrentMillisecond = getMilliseconds(date)\n\n\t\treturn [currentYear, currentMonth, currentDay, currentHour, currentMinute, currentSecond, currentMillisecond].join(\n\t\t\t'-',\n\t\t)\n\t}\n\n\tconst dateAndTime = getDateAndTime()\n\n\tconst getDateDisplay = () => {\n\t\tif (children) return children\n\t\tif (dateAndTime === '') return ''\n\n\t\tconst [dtYear, dtMonth, dtDay, dtHour, dtMinute, dtSecond, dtMillisecond] = dateAndTime.split('-').map(Number)\n\n\t\treturn [\n\t\t\tday && dtDay,\n\t\t\tmonth && [getMonthName(Number(dtMonth) - 1), month && year && ','].filter(Boolean).join(''),\n\t\t\tyear && dtYear,\n\t\t\thours &&\n\t\t\t\tminutes &&\n\t\t\t\t[\n\t\t\t\t\t'at',\n\t\t\t\t\thours && dtHour,\n\t\t\t\t\thours && minutes && ':',\n\t\t\t\t\tminutes && dtMinute,\n\t\t\t\t\tminutes && seconds && ':',\n\t\t\t\t\tseconds && dtSecond,\n\t\t\t\t\tseconds && milliseconds && '.',\n\t\t\t\t\tmilliseconds && dtMillisecond,\n\t\t\t\t]\n\t\t\t\t\t.filter(Boolean)\n\t\t\t\t\t.join(''),\n\t\t]\n\t\t\t.filter(Boolean)\n\t\t\t.join(' ')\n\t}\n\n\tconst dateDisplay = getDateDisplay()\n\n\tuseEffect(() => {\n\t\tif (\n\t\t\tdate === undefined &&\n\t\t\tdateObject === undefined &&\n\t\t\tdateTime === undefined &&\n\t\t\ttypeof window !== 'undefined' &&\n\t\t\t(dateAndTime === '' || dateDisplay === '')\n\t\t)\n\t\t\tsetDate(new Date())\n\t}, [date, setDate, dateAndTime, dateDisplay, dateObject, dateTime])\n\n\treturn (\n\t\t<time dateTime={dateAndTime} ref={ref} {...props}>\n\t\t\t{dateDisplay}\n\t\t</time>\n\t)\n}\n"],"names":["extendTailwindMerge","Children","isValidElement","Fragment","_jsx","twJoin","HeadlessButton","useRef","createContext","useContext","useSyncExternalStore","Provider","useStore","Suspense","validateField","useId","useEffect","_jsxs","Field","Label","HeadlessInput","Description","_Fragment","HeadlessTextarea","useState","createPortal","cloneElement","Dialog","DialogBackdrop","Xmark","DialogPanel"],"mappings":";;;;;;;;AAQA,MAAM,WAAW,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAG,EAAA,CAAC,GAAG,CAAC,CAAE,CAAA,CAAC;AAE9D,MAAM,OAAO,GAAGA,iCAAmB,CAA8B;AACvE,IAAA,MAAM,EAAE;AACP,QAAA,KAAK,EAAE;AACN,YAAA,KAAK,EAAE;AACN,gBAAA;AACC,oBAAA,EAAE,E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,IAAI,IAAI,MAAM;YACd,KAAK;gBACJ,OAAO;AACP,gBAAA;oBACC,IAAI;AACJ,oBAAA,KAAK,IAAI,MAAM;oBACf,KAAK,IAAI,OAAO,IAAI,GAAG;AACvB,oBAAA,OAAO,IAAI,QAAQ;oBACnB,OAAO,IAAI,OAAO,IAAI,GAAG;AACzB,oBAAA,OAAO,IAAI,QAAQ;oBACnB,OAAO,IAAI,YAAY,IAAI,GAAG;AAC9B,oBAAA,YAAY,IAAI,aAAa;AAC7B;qBACC,MAAM,CAAC,OAAO;qBACd,IAAI,CAAC,EAAE,CAAC;AACX;aACC,MAAM,CAAC,OAAO;aACd,IAAI,CAAC,GAAG,CAAC;AACZ,KAAC;AAED,IAAA,MAAM,WAAW,GAAG,cAAc,EAAE;IAEpCR,eAAS,CAAC,MAAK;QACd,IACC,IAAI,KAAK,SAAS;AAClB,YAAA,UAAU,KAAK,SAAS;AACxB,YAAA,QAAQ,KAAK,SAAS;YACtB,OAAO,MAAM,KAAK,WAAW;AAC7B,aAAC,WAAW,KAAK,EAAE,IAAI,WAAW,KAAK,EAAE,CAAC;AAE1C,YAAA,OAAO,CAAC,IAAI,IAAI,EAAE,CAAC;AACrB,KAAC,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC;AAEnE,IAAA,QACCZ,cAAA,CAAA,MAAA,EAAA,EAAM,QAAQ,EAAE,WAAW,EAAE,GAAG,EAAE,GAAG,KAAM,KAAK,EAAA,QAAA,EAC9C,WAAW,EAAA,CACN;AAET;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { createContext, useContext, useSyncExternalStore, useRef, Suspense } from 'react';
|
|
3
|
+
|
|
4
|
+
function createFastContext(defaultInitialState) {
|
|
5
|
+
function useStoreData(initialState = defaultInitialState) {
|
|
6
|
+
const store = useRef(initialState), get = () => store.current, subscribers = useRef(new Set());
|
|
7
|
+
const set = (value) => {
|
|
8
|
+
if (typeof value === 'function') {
|
|
9
|
+
store.current = value(store.current);
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
store.current = value;
|
|
13
|
+
}
|
|
14
|
+
subscribers.current.forEach(callback => callback());
|
|
15
|
+
};
|
|
16
|
+
const subscribe = (callback) => {
|
|
17
|
+
subscribers.current.add(callback);
|
|
18
|
+
return () => subscribers.current.delete(callback);
|
|
19
|
+
};
|
|
20
|
+
return {
|
|
21
|
+
get,
|
|
22
|
+
set,
|
|
23
|
+
subscribe,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
const StoreContext = createContext(null);
|
|
27
|
+
function Provider({ initialValue = defaultInitialState, ...props }) {
|
|
28
|
+
return jsx(StoreContext.Provider, { value: useStoreData(initialValue), ...props });
|
|
29
|
+
}
|
|
30
|
+
function useStore(selector, initialValue) {
|
|
31
|
+
const store = useContext(StoreContext);
|
|
32
|
+
if (!store) {
|
|
33
|
+
const localStoreValue = initialValue !== undefined ? initialValue : defaultInitialState;
|
|
34
|
+
const selectedValue = selector(localStoreValue);
|
|
35
|
+
const noOpSet = () => console.warn('Attempting to set store value outside of Provider');
|
|
36
|
+
return [selectedValue, noOpSet];
|
|
37
|
+
}
|
|
38
|
+
const state = useSyncExternalStore(store.subscribe, () => selector(store.get()), () => selector(initialValue !== undefined ? initialValue : defaultInitialState));
|
|
39
|
+
return [state, store.set];
|
|
40
|
+
}
|
|
41
|
+
return {
|
|
42
|
+
Provider,
|
|
43
|
+
useStore,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* # Define Field
|
|
49
|
+
*
|
|
50
|
+
* This is a helper function to define a field in a form context with type safety.
|
|
51
|
+
*/
|
|
52
|
+
function defineField(fieldDefinition) {
|
|
53
|
+
return fieldDefinition;
|
|
54
|
+
}
|
|
55
|
+
const { Provider: Provider$1, useStore: useStore$1 } = createFastContext([]);
|
|
56
|
+
function FormContextProvider({ children }) {
|
|
57
|
+
return jsx(Provider$1, { children: children });
|
|
58
|
+
}
|
|
59
|
+
function useFormContext() {
|
|
60
|
+
return useStore$1(store => store);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const DEFAULT_STATUS = 'incomplete';
|
|
64
|
+
const { Provider, useStore } = createFastContext(DEFAULT_STATUS);
|
|
65
|
+
function FormStatusProvider({ children, initialStatus = DEFAULT_STATUS, }) {
|
|
66
|
+
return (jsx(Suspense, { children: jsx(Provider, { initialValue: initialStatus, children: children }) }));
|
|
67
|
+
}
|
|
68
|
+
function useFormStatus() {
|
|
69
|
+
return useStore(store => store);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export { FormContextProvider, FormStatusProvider, createFastContext, defineField, useFormContext, useFormStatus };
|
|
73
|
+
//# sourceMappingURL=hooks.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks.esm.js","sources":["../src/hooks/create-fast-context.tsx","../src/hooks/use-form-context.tsx","../src/hooks/use-form-status.tsx"],"sourcesContent":["// * React\nimport { HTMLAttributes, useRef, createContext, useContext, useSyncExternalStore } from 'react'\n\nexport default function createFastContext<Store>(defaultInitialState: Store) {\n\tfunction useStoreData(initialState: Store = defaultInitialState): {\n\t\tget: () => Store\n\t\tset: (value: Store | ((prevState: Store) => Store)) => void\n\t\tsubscribe: (callback: () => void) => () => void\n\t} {\n\t\tconst store = useRef(initialState),\n\t\t\tget = () => store.current,\n\t\t\tsubscribers = useRef(new Set<() => void>())\n\n\t\tconst set = (value: Store | ((prevState: Store) => Store)) => {\n\t\t\tif (typeof value === 'function') {\n\t\t\t\tstore.current = (value as (prevState: Store) => Store)(store.current)\n\t\t\t} else {\n\t\t\t\tstore.current = value\n\t\t\t}\n\t\t\tsubscribers.current.forEach(callback => callback())\n\t\t}\n\n\t\tconst subscribe = (callback: () => void) => {\n\t\t\tsubscribers.current.add(callback)\n\t\t\treturn () => subscribers.current.delete(callback)\n\t\t}\n\n\t\treturn {\n\t\t\tget,\n\t\t\tset,\n\t\t\tsubscribe,\n\t\t}\n\t}\n\n\ttype UseStoreDataReturnType = ReturnType<typeof useStoreData>\n\n\tconst StoreContext = createContext<UseStoreDataReturnType | null>(null)\n\n\tfunction Provider({\n\t\tinitialValue = defaultInitialState,\n\t\t...props\n\t}: Pick<HTMLAttributes<HTMLElement>, 'children'> & { initialValue?: Store }) {\n\t\treturn <StoreContext.Provider value={useStoreData(initialValue)} {...props} />\n\t}\n\n\tfunction useStore<SelectorOutput>(\n\t\tselector: (store: Store) => SelectorOutput,\n\t\tinitialValue?: Store,\n\t): [SelectorOutput | undefined, ((value: Store | ((prevState: Store) => Store)) => void) | undefined] {\n\t\tconst store = useContext(StoreContext)\n\n\t\tif (!store) {\n\t\t\tconst localStoreValue = initialValue !== undefined ? initialValue : defaultInitialState\n\n\t\t\tconst selectedValue = selector(localStoreValue)\n\t\t\tconst noOpSet = () => console.warn('Attempting to set store value outside of Provider')\n\n\t\t\treturn [selectedValue, noOpSet]\n\t\t}\n\n\t\tconst state = useSyncExternalStore(\n\t\t\tstore.subscribe,\n\t\t\t() => selector(store.get()),\n\t\t\t() => selector(initialValue !== undefined ? initialValue : defaultInitialState),\n\t\t)\n\n\t\treturn [state, store.set]\n\t}\n\n\treturn {\n\t\tProvider,\n\t\tuseStore,\n\t}\n}\n","// * Types\nimport { ReactNode } from 'react'\n\nexport type FieldType = 'array' | 'email' | 'file' | 'number' | 'object' | 'string' | 'tel' | 'textarea' | 'url'\n\ntype ArrayObjectOrNormalField =\n\t| { type: 'email' | 'file' | 'number' | 'string' | 'tel' | 'textarea' | 'url' }\n\t| { type: 'array'; of: ArrayObjectOrNormalField }\n\t| { type: 'object'; fields: Field[] }\n\nexport type Field = ArrayObjectOrNormalField & {\n\tid: string\n\tinvalid?: boolean\n\tname: string\n\trequired?: boolean\n\tvalue: string\n}\n\nexport type FormContext = Field[]\n\n// * Hooks\nimport createFastContext from './create-fast-context'\n\n/**\n * # Define Field\n *\n * This is a helper function to define a field in a form context with type safety.\n */\nexport function defineField(fieldDefinition: Field) {\n\treturn fieldDefinition\n}\n\nconst { Provider, useStore } = createFastContext<FormContext>([])\n\nexport function FormContextProvider({ children }: { children?: ReactNode }) {\n\treturn <Provider>{children}</Provider>\n}\n\nexport function useFormContext() {\n\treturn useStore(store => store)\n}\n","// * Types\nimport { ReactNode, Suspense } from 'react'\n\nexport type FormStatus = 'error' | 'incomplete' | 'loading' | 'ready' | 'success' | 'readonly'\n\n// * Hooks\nimport createFastContext from './create-fast-context'\n\nconst DEFAULT_STATUS: FormStatus = 'incomplete'\n\nconst { Provider, useStore } = createFastContext<FormStatus>(DEFAULT_STATUS)\n\nexport function FormStatusProvider({\n\tchildren,\n\tinitialStatus = DEFAULT_STATUS,\n}: {\n\tchildren?: ReactNode\n\tinitialStatus?: FormStatus\n}) {\n\treturn (\n\t\t<Suspense>\n\t\t\t<Provider initialValue={initialStatus}>{children}</Provider>\n\t\t</Suspense>\n\t)\n}\n\nexport function useFormStatus() {\n\treturn useStore(store => store)\n}\n"],"names":["_jsx","Provider","useStore"],"mappings":";;;AAGwB,SAAA,iBAAiB,CAAQ,mBAA0B,EAAA;IAC1E,SAAS,YAAY,CAAC,YAAA,GAAsB,mBAAmB,EAAA;QAK9D,MAAM,KAAK,GAAG,MAAM,CAAC,YAAY,CAAC,EACjC,GAAG,GAAG,MAAM,KAAK,CAAC,OAAO,EACzB,WAAW,GAAG,MAAM,CAAC,IAAI,GAAG,EAAc,CAAC;AAE5C,QAAA,MAAM,GAAG,GAAG,CAAC,KAA4C,KAAI;AAC5D,YAAA,IAAI,OAAO,KAAK,KAAK,UAAU,EAAE;gBAChC,KAAK,CAAC,OAAO,GAAI,KAAqC,CAAC,KAAK,CAAC,OAAO,CAAC;;iBAC/D;AACN,gBAAA,KAAK,CAAC,OAAO,GAAG,KAAK;;AAEtB,YAAA,WAAW,CAAC,OAAO,CAAC,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AAQ;QACR,QAAQ;KACR;AACF;;AClDA;;;;AAIG;AACG,SAAU,WAAW,CAAC,eAAsB,EAAA;AACjD,IAAA,OAAO,eAAe;AACvB;AAEA,MAAM,YAAEC,UAAQ,YAAEC,UAAQ,EAAE,GAAG,iBAAiB,CAAc,EAAE,CAAC;AAEjD,SAAA,mBAAmB,CAAC,EAAE,QAAQ,EAA4B,EAAA;AACzE,IAAA,OAAOF,GAAC,CAAAC,UAAQ,EAAE,EAAA,QAAA,EAAA,QAAQ,GAAY;AACvC;SAEgB,cAAc,GAAA;IAC7B,OAAOC,UAAQ,CAAC,KAAK,IAAI,KAAK,CAAC;AAChC;;AChCA,MAAM,cAAc,GAAe,YAAY;AAE/C,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,iBAAiB,CAAa,cAAc,CAAC;AAEtE,SAAU,kBAAkB,CAAC,EAClC,QAAQ,EACR,aAAa,GAAG,cAAc,GAI9B,EAAA;AACA,IAAA,QACCF,GAAA,CAAC,QAAQ,EAAA,EAAA,QAAA,EACRA,IAAC,QAAQ,EAAA,EAAC,YAAY,EAAE,aAAa,EAAG,QAAA,EAAA,QAAQ,EAAY,CAAA,EAAA,CAClD;AAEb;SAEgB,aAAa,GAAA;IAC5B,OAAO,QAAQ,CAAC,KAAK,IAAI,KAAK,CAAC;AAChC;;;;"}
|
package/dist/hooks.js
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var react = require('react');
|
|
5
|
+
|
|
6
|
+
function createFastContext(defaultInitialState) {
|
|
7
|
+
function useStoreData(initialState = defaultInitialState) {
|
|
8
|
+
const store = react.useRef(initialState), get = () => store.current, subscribers = react.useRef(new Set());
|
|
9
|
+
const set = (value) => {
|
|
10
|
+
if (typeof value === 'function') {
|
|
11
|
+
store.current = value(store.current);
|
|
12
|
+
}
|
|
13
|
+
else {
|
|
14
|
+
store.current = value;
|
|
15
|
+
}
|
|
16
|
+
subscribers.current.forEach(callback => callback());
|
|
17
|
+
};
|
|
18
|
+
const subscribe = (callback) => {
|
|
19
|
+
subscribers.current.add(callback);
|
|
20
|
+
return () => subscribers.current.delete(callback);
|
|
21
|
+
};
|
|
22
|
+
return {
|
|
23
|
+
get,
|
|
24
|
+
set,
|
|
25
|
+
subscribe,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
const StoreContext = react.createContext(null);
|
|
29
|
+
function Provider({ initialValue = defaultInitialState, ...props }) {
|
|
30
|
+
return jsxRuntime.jsx(StoreContext.Provider, { value: useStoreData(initialValue), ...props });
|
|
31
|
+
}
|
|
32
|
+
function useStore(selector, initialValue) {
|
|
33
|
+
const store = react.useContext(StoreContext);
|
|
34
|
+
if (!store) {
|
|
35
|
+
const localStoreValue = initialValue !== undefined ? initialValue : defaultInitialState;
|
|
36
|
+
const selectedValue = selector(localStoreValue);
|
|
37
|
+
const noOpSet = () => console.warn('Attempting to set store value outside of Provider');
|
|
38
|
+
return [selectedValue, noOpSet];
|
|
39
|
+
}
|
|
40
|
+
const state = react.useSyncExternalStore(store.subscribe, () => selector(store.get()), () => selector(initialValue !== undefined ? initialValue : defaultInitialState));
|
|
41
|
+
return [state, store.set];
|
|
42
|
+
}
|
|
43
|
+
return {
|
|
44
|
+
Provider,
|
|
45
|
+
useStore,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* # Define Field
|
|
51
|
+
*
|
|
52
|
+
* This is a helper function to define a field in a form context with type safety.
|
|
53
|
+
*/
|
|
54
|
+
function defineField(fieldDefinition) {
|
|
55
|
+
return fieldDefinition;
|
|
56
|
+
}
|
|
57
|
+
const { Provider: Provider$1, useStore: useStore$1 } = createFastContext([]);
|
|
58
|
+
function FormContextProvider({ children }) {
|
|
59
|
+
return jsxRuntime.jsx(Provider$1, { children: children });
|
|
60
|
+
}
|
|
61
|
+
function useFormContext() {
|
|
62
|
+
return useStore$1(store => store);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const DEFAULT_STATUS = 'incomplete';
|
|
66
|
+
const { Provider, useStore } = createFastContext(DEFAULT_STATUS);
|
|
67
|
+
function FormStatusProvider({ children, initialStatus = DEFAULT_STATUS, }) {
|
|
68
|
+
return (jsxRuntime.jsx(react.Suspense, { children: jsxRuntime.jsx(Provider, { initialValue: initialStatus, children: children }) }));
|
|
69
|
+
}
|
|
70
|
+
function useFormStatus() {
|
|
71
|
+
return useStore(store => store);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
exports.FormContextProvider = FormContextProvider;
|
|
75
|
+
exports.FormStatusProvider = FormStatusProvider;
|
|
76
|
+
exports.createFastContext = createFastContext;
|
|
77
|
+
exports.defineField = defineField;
|
|
78
|
+
exports.useFormContext = useFormContext;
|
|
79
|
+
exports.useFormStatus = useFormStatus;
|
|
80
|
+
//# sourceMappingURL=hooks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks.js","sources":["../src/hooks/create-fast-context.tsx","../src/hooks/use-form-context.tsx","../src/hooks/use-form-status.tsx"],"sourcesContent":["// * React\nimport { HTMLAttributes, useRef, createContext, useContext, useSyncExternalStore } from 'react'\n\nexport default function createFastContext<Store>(defaultInitialState: Store) {\n\tfunction useStoreData(initialState: Store = defaultInitialState): {\n\t\tget: () => Store\n\t\tset: (value: Store | ((prevState: Store) => Store)) => void\n\t\tsubscribe: (callback: () => void) => () => void\n\t} {\n\t\tconst store = useRef(initialState),\n\t\t\tget = () => store.current,\n\t\t\tsubscribers = useRef(new Set<() => void>())\n\n\t\tconst set = (value: Store | ((prevState: Store) => Store)) => {\n\t\t\tif (typeof value === 'function') {\n\t\t\t\tstore.current = (value as (prevState: Store) => Store)(store.current)\n\t\t\t} else {\n\t\t\t\tstore.current = value\n\t\t\t}\n\t\t\tsubscribers.current.forEach(callback => callback())\n\t\t}\n\n\t\tconst subscribe = (callback: () => void) => {\n\t\t\tsubscribers.current.add(callback)\n\t\t\treturn () => subscribers.current.delete(callback)\n\t\t}\n\n\t\treturn {\n\t\t\tget,\n\t\t\tset,\n\t\t\tsubscribe,\n\t\t}\n\t}\n\n\ttype UseStoreDataReturnType = ReturnType<typeof useStoreData>\n\n\tconst StoreContext = createContext<UseStoreDataReturnType | null>(null)\n\n\tfunction Provider({\n\t\tinitialValue = defaultInitialState,\n\t\t...props\n\t}: Pick<HTMLAttributes<HTMLElement>, 'children'> & { initialValue?: Store }) {\n\t\treturn <StoreContext.Provider value={useStoreData(initialValue)} {...props} />\n\t}\n\n\tfunction useStore<SelectorOutput>(\n\t\tselector: (store: Store) => SelectorOutput,\n\t\tinitialValue?: Store,\n\t): [SelectorOutput | undefined, ((value: Store | ((prevState: Store) => Store)) => void) | undefined] {\n\t\tconst store = useContext(StoreContext)\n\n\t\tif (!store) {\n\t\t\tconst localStoreValue = initialValue !== undefined ? initialValue : defaultInitialState\n\n\t\t\tconst selectedValue = selector(localStoreValue)\n\t\t\tconst noOpSet = () => console.warn('Attempting to set store value outside of Provider')\n\n\t\t\treturn [selectedValue, noOpSet]\n\t\t}\n\n\t\tconst state = useSyncExternalStore(\n\t\t\tstore.subscribe,\n\t\t\t() => selector(store.get()),\n\t\t\t() => selector(initialValue !== undefined ? initialValue : defaultInitialState),\n\t\t)\n\n\t\treturn [state, store.set]\n\t}\n\n\treturn {\n\t\tProvider,\n\t\tuseStore,\n\t}\n}\n","// * Types\nimport { ReactNode } from 'react'\n\nexport type FieldType = 'array' | 'email' | 'file' | 'number' | 'object' | 'string' | 'tel' | 'textarea' | 'url'\n\ntype ArrayObjectOrNormalField =\n\t| { type: 'email' | 'file' | 'number' | 'string' | 'tel' | 'textarea' | 'url' }\n\t| { type: 'array'; of: ArrayObjectOrNormalField }\n\t| { type: 'object'; fields: Field[] }\n\nexport type Field = ArrayObjectOrNormalField & {\n\tid: string\n\tinvalid?: boolean\n\tname: string\n\trequired?: boolean\n\tvalue: string\n}\n\nexport type FormContext = Field[]\n\n// * Hooks\nimport createFastContext from './create-fast-context'\n\n/**\n * # Define Field\n *\n * This is a helper function to define a field in a form context with type safety.\n */\nexport function defineField(fieldDefinition: Field) {\n\treturn fieldDefinition\n}\n\nconst { Provider, useStore } = createFastContext<FormContext>([])\n\nexport function FormContextProvider({ children }: { children?: ReactNode }) {\n\treturn <Provider>{children}</Provider>\n}\n\nexport function useFormContext() {\n\treturn useStore(store => store)\n}\n","// * Types\nimport { ReactNode, Suspense } from 'react'\n\nexport type FormStatus = 'error' | 'incomplete' | 'loading' | 'ready' | 'success' | 'readonly'\n\n// * Hooks\nimport createFastContext from './create-fast-context'\n\nconst DEFAULT_STATUS: FormStatus = 'incomplete'\n\nconst { Provider, useStore } = createFastContext<FormStatus>(DEFAULT_STATUS)\n\nexport function FormStatusProvider({\n\tchildren,\n\tinitialStatus = DEFAULT_STATUS,\n}: {\n\tchildren?: ReactNode\n\tinitialStatus?: FormStatus\n}) {\n\treturn (\n\t\t<Suspense>\n\t\t\t<Provider initialValue={initialStatus}>{children}</Provider>\n\t\t</Suspense>\n\t)\n}\n\nexport function useFormStatus() {\n\treturn useStore(store => store)\n}\n"],"names":["useRef","createContext","_jsx","useContext","useSyncExternalStore","Provider","useStore","Suspense"],"mappings":";;;;;AAGwB,SAAA,iBAAiB,CAAQ,mBAA0B,EAAA;IAC1E,SAAS,YAAY,CAAC,YAAA,GAAsB,mBAAmB,EAAA;QAK9D,MAAM,KAAK,GAAGA,YAAM,CAAC,YAAY,CAAC,EACjC,GAAG,GAAG,MAAM,KAAK,CAAC,OAAO,EACzB,WAAW,GAAGA,YAAM,CAAC,IAAI,GAAG,EAAc,CAAC;AAE5C,QAAA,MAAM,GAAG,GAAG,CAAC,KAA4C,KAAI;AAC5D,YAAA,IAAI,OAAO,KAAK,KAAK,UAAU,EAAE;gBAChC,KAAK,CAAC,OAAO,GAAI,KAAqC,CAAC,KAAK,CAAC,OAAO,CAAC;;iBAC/D;AACN,gBAAA,KAAK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