@kilnonedre/foundation 0.0.1 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -112,16 +112,16 @@ type SemanticColorToken = {
112
112
  };
113
113
  declare const getSemanticColor: (semanticColor: EnumSemanticColor, variant: EnumVariant) => SemanticColorToken;
114
114
 
115
- interface ConfigProp$d {
115
+ interface ConfigProp$e {
116
116
  semanticColor?: EnumSemanticColor;
117
117
  variant?: EnumVariant;
118
118
  children?: ReactNode;
119
119
  className?: string;
120
120
  }
121
121
 
122
- declare const Badge: ({ semanticColor, variant, children, className, }: ConfigProp$d) => react_jsx_runtime.JSX.Element;
122
+ declare const Badge: ({ semanticColor, variant, children, className, }: ConfigProp$e) => react_jsx_runtime.JSX.Element;
123
123
 
124
- interface ConfigProp$c {
124
+ interface ConfigProp$d {
125
125
  semanticColor?: EnumSemanticColor;
126
126
  variant?: EnumVariant;
127
127
  children?: ReactNode;
@@ -133,7 +133,7 @@ interface ConfigProp$c {
133
133
  type?: 'button' | 'submit' | 'reset';
134
134
  }
135
135
 
136
- declare const Button: ({ semanticColor, variant, children, className, onClick, disabled, type, size, loading, }: ConfigProp$c) => react_jsx_runtime.JSX.Element;
136
+ declare const Button: ({ semanticColor, variant, children, className, onClick, disabled, type, size, loading, }: ConfigProp$d) => react_jsx_runtime.JSX.Element;
137
137
 
138
138
  type UUID = `${string}-${string}-${string}-${string}-${string}`;
139
139
 
@@ -147,6 +147,14 @@ interface CommonOption {
147
147
  label: string;
148
148
  }
149
149
 
150
+ interface ConfigProp$c {
151
+ options: Array<CommonOption>;
152
+ value?: string | null;
153
+ onChange: (_v: string) => void;
154
+ }
155
+
156
+ declare const CheckboxSingleList: (props: ConfigProp$c) => react_jsx_runtime.JSX.Element;
157
+
150
158
  interface ConfigListRespT<T> {
151
159
  items: Array<T>;
152
160
  pageInfo: {
@@ -414,4 +422,4 @@ declare const zCoerceNumberOptional: (label: string, min?: number, max?: number)
414
422
  declare const zDecimal: (label: string, min?: number, max?: number) => z.ZodString;
415
423
  declare const zDecimalOptional: (label: string, min?: number, max?: number) => z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
416
424
 
417
- export { Badge, Button, type CommonObject, type CommonOption, DataTable, Dialog, DisplayTable, DropdownCascader, DropdownCascaderMulti, EnumApprovalStatus, EnumApprovalStatusLabel, EnumApprovalView, EnumApprovalViewLabel, EnumEntityStatus, EnumEntityStatusLabel, EnumFormMode, EnumFormModeLabel, EnumGenderType, EnumGenderTypeLabel, EnumMapProvider, EnumMapProviderLabel, EnumOrderStatus, EnumOrderStatusLabel, EnumPublishMethod, EnumPublishMethodLabel, EnumSemanticColor, EnumSemanticColorLabel, EnumStorageMethod, EnumStorageMethodLabel, EnumVariant, EnumVariantLabel, FieldController, FieldGroup, FieldPlain, FieldText, FormSelect, FormTimePicker, MediaUploader, Provider, type SemanticColorToken, TableFormDialog, TablePagination, Text, type UUID, boolToText, cn, emptyToUndefined, enumToOptions, enumValues, formatDateTime, formatDecimal, genUuid, getSemanticColor, isEmpty, isFormData, isValidEmail, isValidURL, zBool, zCoerceNumber, zCoerceNumberOptional, zDate, zDateOptional, zDecimal, zDecimalOptional, zEmail, zEnumNullable, zEnumNullableOptional, zEnumNullableRequired, zEnumOptional, zEnumRequired, zId, zIdCard, zIdCardOptional, zIds, zImageId, zImageIdRequired, zImageIds, zImageIdsOptional, zNumber, zNumberOptional, zPhone, zTextOptional, zTextRequired, zTexts };
425
+ export { Badge, Button, CheckboxSingleList, type CommonObject, type CommonOption, DataTable, Dialog, DisplayTable, DropdownCascader, DropdownCascaderMulti, EnumApprovalStatus, EnumApprovalStatusLabel, EnumApprovalView, EnumApprovalViewLabel, EnumEntityStatus, EnumEntityStatusLabel, EnumFormMode, EnumFormModeLabel, EnumGenderType, EnumGenderTypeLabel, EnumMapProvider, EnumMapProviderLabel, EnumOrderStatus, EnumOrderStatusLabel, EnumPublishMethod, EnumPublishMethodLabel, EnumSemanticColor, EnumSemanticColorLabel, EnumStorageMethod, EnumStorageMethodLabel, EnumVariant, EnumVariantLabel, FieldController, FieldGroup, FieldPlain, FieldText, FormSelect, FormTimePicker, MediaUploader, Provider, type SemanticColorToken, TableFormDialog, TablePagination, Text, type UUID, boolToText, cn, emptyToUndefined, enumToOptions, enumValues, formatDateTime, formatDecimal, genUuid, getSemanticColor, isEmpty, isFormData, isValidEmail, isValidURL, zBool, zCoerceNumber, zCoerceNumberOptional, zDate, zDateOptional, zDecimal, zDecimalOptional, zEmail, zEnumNullable, zEnumNullableOptional, zEnumNullableRequired, zEnumOptional, zEnumRequired, zId, zIdCard, zIdCardOptional, zIds, zImageId, zImageIdRequired, zImageIds, zImageIdsOptional, zNumber, zNumberOptional, zPhone, zTextOptional, zTextRequired, zTexts };
package/dist/index.js CHANGED
@@ -597,9 +597,51 @@ var Button2 = ({
597
597
  import { CheckIcon } from "lucide-react";
598
598
  import { Checkbox as CheckboxPrimitive } from "radix-ui";
599
599
  import { jsx as jsx6 } from "react/jsx-runtime";
600
+ function Checkbox({
601
+ className,
602
+ ...props
603
+ }) {
604
+ return /* @__PURE__ */ jsx6(
605
+ CheckboxPrimitive.Root,
606
+ {
607
+ "data-slot": "checkbox",
608
+ className: cn(
609
+ "peer size-4 shrink-0 rounded-[4px] border border-input shadow-xs transition-shadow outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:bg-input/30 dark:aria-invalid:ring-destructive/40 dark:data-[state=checked]:bg-primary",
610
+ className
611
+ ),
612
+ ...props,
613
+ children: /* @__PURE__ */ jsx6(
614
+ CheckboxPrimitive.Indicator,
615
+ {
616
+ "data-slot": "checkbox-indicator",
617
+ className: "grid place-content-center text-current transition-none",
618
+ children: /* @__PURE__ */ jsx6(CheckIcon, { className: "size-3.5" })
619
+ }
620
+ )
621
+ }
622
+ );
623
+ }
600
624
 
601
625
  // src/components/checkbox-list/single/index.tsx
602
626
  import { jsx as jsx7, jsxs as jsxs2 } from "react/jsx-runtime";
627
+ var CheckboxSingleList = (props) => {
628
+ return /* @__PURE__ */ jsx7("div", { className: "flex gap-4", children: props.options.map((opt) => /* @__PURE__ */ jsxs2("label", { className: "flex items-center gap-2", children: [
629
+ /* @__PURE__ */ jsx7(
630
+ Checkbox,
631
+ {
632
+ checked: props.value === opt.value,
633
+ onCheckedChange: () => {
634
+ if (props.value === opt.value) {
635
+ props.onChange("");
636
+ } else {
637
+ props.onChange(opt.value);
638
+ }
639
+ }
640
+ }
641
+ ),
642
+ /* @__PURE__ */ jsx7("span", { children: opt.label })
643
+ ] }, opt.value)) });
644
+ };
603
645
 
604
646
  // src/components/data-table/index.tsx
605
647
  import { useEffect, useMemo as useMemo2, useState } from "react";
@@ -2488,15 +2530,15 @@ import { ChevronDownIcon as ChevronDownIcon4 } from "lucide-react";
2488
2530
 
2489
2531
  // src/shadcn/components/calendar.tsx
2490
2532
  import * as React3 from "react";
2533
+ import {
2534
+ DayPicker,
2535
+ getDefaultClassNames
2536
+ } from "react-day-picker";
2491
2537
  import {
2492
2538
  ChevronDownIcon as ChevronDownIcon3,
2493
2539
  ChevronLeftIcon as ChevronLeftIcon2,
2494
2540
  ChevronRightIcon as ChevronRightIcon3
2495
2541
  } from "lucide-react";
2496
- import {
2497
- DayPicker,
2498
- getDefaultClassNames
2499
- } from "react-day-picker";
2500
2542
  import { jsx as jsx39 } from "react/jsx-runtime";
2501
2543
  function Calendar({
2502
2544
  className,
@@ -3031,6 +3073,7 @@ var Provider = ({ children }) => {
3031
3073
  export {
3032
3074
  Badge2 as Badge,
3033
3075
  Button2 as Button,
3076
+ CheckboxSingleList,
3034
3077
  DataTable,
3035
3078
  Dialog2 as Dialog,
3036
3079
  DisplayTable,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kilnonedre/foundation",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "private": false,
5
5
  "description": "Kilnonedre frontend foundation package",
6
6
  "type": "module",