@kilnonedre/foundation 0.0.15 → 0.0.17

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
@@ -136,16 +136,16 @@ type SemanticColorToken = {
136
136
  };
137
137
  declare const getSemanticColor: (semanticColor: EnumSemanticColor, variant: EnumVariant) => SemanticColorToken;
138
138
 
139
- interface ConfigProp$i {
139
+ interface ConfigProp$j {
140
140
  semanticColor?: EnumSemanticColor;
141
141
  variant?: EnumVariant;
142
142
  children?: ReactNode;
143
143
  className?: string;
144
144
  }
145
145
 
146
- declare const Badge: ({ semanticColor, variant, children, className, }: ConfigProp$i) => react_jsx_runtime.JSX.Element;
146
+ declare const Badge: ({ semanticColor, variant, children, className, }: ConfigProp$j) => react_jsx_runtime.JSX.Element;
147
147
 
148
- interface ConfigProp$h {
148
+ interface ConfigProp$i {
149
149
  semanticColor?: EnumSemanticColor;
150
150
  variant?: EnumVariant;
151
151
  children?: ReactNode;
@@ -157,15 +157,15 @@ interface ConfigProp$h {
157
157
  type?: 'button' | 'submit' | 'reset';
158
158
  }
159
159
 
160
- declare const Button: ({ semanticColor, variant, children, className, onClick, disabled, type, size, loading, }: ConfigProp$h) => react_jsx_runtime.JSX.Element;
160
+ declare const Button: ({ semanticColor, variant, children, className, onClick, disabled, type, size, loading, }: ConfigProp$i) => react_jsx_runtime.JSX.Element;
161
161
 
162
- interface ConfigProp$g {
162
+ interface ConfigProp$h {
163
163
  options: Array<CommonOption>;
164
164
  value?: string | null;
165
165
  onChange: (_v: string) => void;
166
166
  }
167
167
 
168
- declare const CheckboxSingleList: (props: ConfigProp$g) => react_jsx_runtime.JSX.Element;
168
+ declare const CheckboxSingleList: (props: ConfigProp$h) => react_jsx_runtime.JSX.Element;
169
169
 
170
170
  interface ConfigListRespT<T> {
171
171
  items: Array<T>;
@@ -193,7 +193,7 @@ type AdvancedFilterCtx = {
193
193
  draftFilters: Record<string, unknown>;
194
194
  setDraftFilters: (_updater: (_prev: Record<string, unknown>) => Record<string, unknown>) => void;
195
195
  };
196
- type ConfigProp$f<T, P> = {
196
+ type ConfigProp$g<T, P> = {
197
197
  columns: Array<ColumnDef<T>>;
198
198
  renderList: (_params: P) => Promise<ConfigApiRespT<ConfigListRespT<T>>>;
199
199
  getRowId?: (_row: T) => string;
@@ -221,7 +221,7 @@ declare const KeywordSearchBar: (props: ConfigProps$1) => react_jsx_runtime.JSX.
221
221
 
222
222
  declare const TableEmpty: () => react_jsx_runtime.JSX.Element;
223
223
 
224
- interface ConfigProp$e {
224
+ interface ConfigProp$f {
225
225
  id?: string;
226
226
  mode: EnumFormMode;
227
227
  children: ReactNode;
@@ -235,22 +235,22 @@ interface ConfigProp$e {
235
235
  onOpenChange: (_nextOpen: boolean) => void;
236
236
  }
237
237
 
238
- declare const TableFormDialog: (props: ConfigProp$e) => react_jsx_runtime.JSX.Element;
238
+ declare const TableFormDialog: (props: ConfigProp$f) => react_jsx_runtime.JSX.Element;
239
239
 
240
- interface ConfigProp$d {
240
+ interface ConfigProp$e {
241
241
  text: string;
242
242
  className?: ClassValue;
243
243
  }
244
244
 
245
- declare const TableHeaderText: (props: ConfigProp$d) => react_jsx_runtime.JSX.Element;
245
+ declare const TableHeaderText: (props: ConfigProp$e) => react_jsx_runtime.JSX.Element;
246
246
 
247
- interface ConfigProp$c {
247
+ interface ConfigProp$d {
248
248
  value: Array<CommonObject>;
249
249
  }
250
250
 
251
- declare const TableImage: (props: ConfigProp$c) => react_jsx_runtime.JSX.Element;
251
+ declare const TableImage: (props: ConfigProp$d) => react_jsx_runtime.JSX.Element;
252
252
 
253
- interface ConfigProp$b {
253
+ interface ConfigProp$c {
254
254
  totalPage: number;
255
255
  size: number;
256
256
  sizeList: Array<number>;
@@ -259,18 +259,18 @@ interface ConfigProp$b {
259
259
  onUpdateSize: (_size: number) => void;
260
260
  }
261
261
 
262
- declare const TablePagination: (props: ConfigProp$b) => react_jsx_runtime.JSX.Element;
262
+ declare const TablePagination: (props: ConfigProp$c) => react_jsx_runtime.JSX.Element;
263
263
 
264
- interface ConfigProp$a {
264
+ interface ConfigProp$b {
265
265
  text?: string | number;
266
266
  wrap?: boolean;
267
267
  }
268
268
 
269
- declare const TableText: (props: ConfigProp$a) => react_jsx_runtime.JSX.Element;
269
+ declare const TableText: (props: ConfigProp$b) => react_jsx_runtime.JSX.Element;
270
270
 
271
- declare const DataTable: <T, P>(props: ConfigProp$f<T, P>) => react_jsx_runtime.JSX.Element;
271
+ declare const DataTable: <T, P>(props: ConfigProp$g<T, P>) => react_jsx_runtime.JSX.Element;
272
272
 
273
- interface ConfigProp$9 {
273
+ interface ConfigProp$a {
274
274
  children: ReactNode;
275
275
  title?: string;
276
276
  content?: ReactNode;
@@ -279,9 +279,9 @@ interface ConfigProp$9 {
279
279
  onConfirm?: () => void | Promise<void>;
280
280
  }
281
281
 
282
- declare const Dialog: (props: ConfigProp$9) => react_jsx_runtime.JSX.Element;
282
+ declare const Dialog: (props: ConfigProp$a) => react_jsx_runtime.JSX.Element;
283
283
 
284
- interface ConfigProp$8<T> {
284
+ interface ConfigProp$9<T> {
285
285
  columns: Array<ColumnDef<T>>;
286
286
  list?: Array<T>;
287
287
  enableRowSelection?: boolean;
@@ -290,7 +290,7 @@ interface ConfigProp$8<T> {
290
290
  navigate?: (_id: UUID) => void;
291
291
  }
292
292
 
293
- declare const DisplayTable: <T>(props: ConfigProp$8<T>) => react_jsx_runtime.JSX.Element;
293
+ declare const DisplayTable: <T>(props: ConfigProp$9<T>) => react_jsx_runtime.JSX.Element;
294
294
 
295
295
  interface ConfigCascaderOption {
296
296
  label: string;
@@ -327,7 +327,7 @@ declare const DropdownCascaderMulti: ({ value, ...props }: ConfigDropdownCascade
327
327
 
328
328
  declare const DropdownCascaderSingle: (props: ConfigDropdownCascaderSingleProp) => react_jsx_runtime.JSX.Element;
329
329
 
330
- interface ConfigProp$7<T extends FieldValues, TName extends FieldPath<T> = FieldPath<T>> {
330
+ interface ConfigProp$8<T extends FieldValues, TName extends FieldPath<T> = FieldPath<T>> {
331
331
  id: string;
332
332
  name: TName;
333
333
  label: string;
@@ -342,16 +342,16 @@ interface ConfigProp$7<T extends FieldValues, TName extends FieldPath<T> = Field
342
342
  }) => ReactNode;
343
343
  }
344
344
 
345
- declare const FieldController: <T extends FieldValues, TName extends FieldPath<T> = FieldPath<T>>({ required, ...props }: ConfigProp$7<T, TName>) => react_jsx_runtime.JSX.Element;
345
+ declare const FieldController: <T extends FieldValues, TName extends FieldPath<T> = FieldPath<T>>({ required, ...props }: ConfigProp$8<T, TName>) => react_jsx_runtime.JSX.Element;
346
346
 
347
- interface ConfigProp$6 {
347
+ interface ConfigProp$7 {
348
348
  className?: string;
349
349
  children: ReactNode;
350
350
  }
351
351
 
352
- declare const FieldGroup: (props: ConfigProp$6) => react_jsx_runtime.JSX.Element;
352
+ declare const FieldGroup: (props: ConfigProp$7) => react_jsx_runtime.JSX.Element;
353
353
 
354
- interface ConfigProp$5 {
354
+ interface ConfigProp$6 {
355
355
  id: string;
356
356
  name: string;
357
357
  required?: boolean;
@@ -362,9 +362,9 @@ interface ConfigProp$5 {
362
362
  children?: ReactNode;
363
363
  }
364
364
 
365
- declare const FieldPlain: ({ required, mode, ...props }: ConfigProp$5) => react_jsx_runtime.JSX.Element;
365
+ declare const FieldPlain: ({ required, mode, ...props }: ConfigProp$6) => react_jsx_runtime.JSX.Element;
366
366
 
367
- interface ConfigProp$4 {
367
+ interface ConfigProp$5 {
368
368
  id?: string;
369
369
  name: string;
370
370
  value?: string | number | null;
@@ -373,9 +373,9 @@ interface ConfigProp$4 {
373
373
  render?: ReactNode;
374
374
  }
375
375
 
376
- declare const FieldText: ({ id, name, value, placeholder, required, render, }: ConfigProp$4) => react_jsx_runtime.JSX.Element;
376
+ declare const FieldText: ({ id, name, value, placeholder, required, render, }: ConfigProp$5) => react_jsx_runtime.JSX.Element;
377
377
 
378
- interface ConfigProp$3 {
378
+ interface ConfigProp$4 {
379
379
  value: string;
380
380
  onValueChange: (_val: string) => void;
381
381
  onLabelChange?: (_val: string) => void;
@@ -383,9 +383,9 @@ interface ConfigProp$3 {
383
383
  optionList: Array<CommonOption>;
384
384
  }
385
385
 
386
- declare const FormSelect: (props: ConfigProp$3) => react_jsx_runtime.JSX.Element;
386
+ declare const FormSelect: (props: ConfigProp$4) => react_jsx_runtime.JSX.Element;
387
387
 
388
- interface ConfigProp$2 {
388
+ interface ConfigProp$3 {
389
389
  value?: Date;
390
390
  onChange: (_value?: Date) => void;
391
391
  id?: string;
@@ -394,7 +394,7 @@ interface ConfigProp$2 {
394
394
  timePlaceholder?: string;
395
395
  }
396
396
 
397
- declare const FormTimePicker: (props: ConfigProp$2) => react_jsx_runtime.JSX.Element;
397
+ declare const FormTimePicker: (props: ConfigProp$3) => react_jsx_runtime.JSX.Element;
398
398
 
399
399
  interface ConfigProps {
400
400
  value?: Array<string>;
@@ -415,12 +415,19 @@ declare const Provider: ({ children }: {
415
415
  children: React.ReactNode;
416
416
  }) => react_jsx_runtime.JSX.Element;
417
417
 
418
+ interface ConfigProp$2 {
419
+ children: ReactNode;
420
+ className?: ClassValue;
421
+ }
422
+
423
+ declare const Text: (props: ConfigProp$2) => react_jsx_runtime.JSX.Element;
424
+
418
425
  interface ConfigProp$1 {
419
426
  children: ReactNode;
420
427
  className?: ClassValue;
421
428
  }
422
429
 
423
- declare const Text: (props: ConfigProp$1) => react_jsx_runtime.JSX.Element;
430
+ declare const Title: (props: ConfigProp$1) => react_jsx_runtime.JSX.Element;
424
431
 
425
432
  interface ConfigProp<T extends object, K extends keyof T> {
426
433
  key: K;
@@ -509,7 +516,7 @@ declare const zEnumOptional: <T extends Record<string, string>>(enumObj: T) => z
509
516
  declare const zEnumNullableOptional: <T extends Record<string, string>>(enumObj: T) => z.ZodOptional<z.ZodNullable<z.ZodEnum<{ [k_1 in T[keyof T]]: k_1; } extends infer T_1 ? { [k in keyof T_1]: T_1[k]; } : never>>>;
510
517
  declare const zBool: () => z.ZodBoolean;
511
518
  declare const zDate: (label: string) => z.ZodDate;
512
- declare const zDateOptional: () => z.ZodOptional<z.ZodDate>;
519
+ declare const zDateOptional: (label: string) => z.ZodOptional<z.ZodDate>;
513
520
  declare const zNumber: (label: string, min?: number, max?: number) => z.ZodNumber;
514
521
  declare const zNumberOptional: (label: string, min?: number, max?: number) => z.ZodOptional<z.ZodNumber>;
515
522
  declare const zCoerceNumber: (label: string, min?: number, max?: number) => z.ZodCoercedNumber<unknown>;
@@ -517,4 +524,4 @@ declare const zCoerceNumberOptional: (label: string, min?: number, max?: number)
517
524
  declare const zDecimal: (label: string, min?: number, max?: number) => z.ZodString;
518
525
  declare const zDecimalOptional: (label: string, min?: number, max?: number) => z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
519
526
 
520
- export { Badge, Button, CheckboxSingleList, type CommonObject, type CommonOption, type ConfigCascaderOption, type ConfigDropdownCascaderMultiProp, type ConfigDropdownCascaderSingleProp, type ConfigRenderBase, type ConfigRenderPasswordInput, DataTable, Dialog, DisplayTable, DropdownCascaderMulti, DropdownCascaderSingle, 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, KeywordSearchBar, MediaUploader, Provider, type SemanticColorToken, TableEmpty, TableFormDialog, TableHeaderText, TableImage, TablePagination, TableText, Text, type UUID, boolToText, buildColumn, cn, emptyToUndefined, enumApprovalStatusOptions, enumApprovalViewOptions, enumEntityStatusOptions, enumFormModeOptions, enumGenderTypeOptions, enumMapProviderOptions, enumOrderStatusOptions, enumPublishMethodOptions, enumSemanticColorOptions, enumStorageMethodOptions, enumToOptions, enumValues, enumVariantOptions, formatDateTime, formatDecimal, genUuid, getOptionMap, getSemanticColor, getSuccessMessage, isEmpty, isFormData, isValidEmail, isValidURL, renderBody, renderCascaderNodes, renderConfirmFooter, renderFooter, renderInput, renderPasswordInput, renderTextarea, 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 };
527
+ export { Badge, Button, CheckboxSingleList, type CommonObject, type CommonOption, type ConfigCascaderOption, type ConfigDropdownCascaderMultiProp, type ConfigDropdownCascaderSingleProp, type ConfigRenderBase, type ConfigRenderPasswordInput, DataTable, Dialog, DisplayTable, DropdownCascaderMulti, DropdownCascaderSingle, 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, KeywordSearchBar, MediaUploader, Provider, type SemanticColorToken, TableEmpty, TableFormDialog, TableHeaderText, TableImage, TablePagination, TableText, Text, Title, type UUID, boolToText, buildColumn, cn, emptyToUndefined, enumApprovalStatusOptions, enumApprovalViewOptions, enumEntityStatusOptions, enumFormModeOptions, enumGenderTypeOptions, enumMapProviderOptions, enumOrderStatusOptions, enumPublishMethodOptions, enumSemanticColorOptions, enumStorageMethodOptions, enumToOptions, enumValues, enumVariantOptions, formatDateTime, formatDecimal, genUuid, getOptionMap, getSemanticColor, getSuccessMessage, isEmpty, isFormData, isValidEmail, isValidURL, renderBody, renderCascaderNodes, renderConfirmFooter, renderFooter, renderInput, renderPasswordInput, renderTextarea, 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
@@ -567,7 +567,9 @@ var zBool = () => z.boolean();
567
567
  var zDate = (label) => z.date({
568
568
  message: `\u8BF7\u9009\u62E9${label}`
569
569
  });
570
- var zDateOptional = () => z.date().optional();
570
+ var zDateOptional = (label) => z.date({
571
+ message: `\u8BF7\u9009\u62E9${label}`
572
+ }).optional();
571
573
  var zNumber = (label, min, max) => {
572
574
  let schema = z.number({
573
575
  message: `\u8BF7\u8F93\u5165${label}`
@@ -3437,16 +3439,22 @@ var Provider = ({ children }) => {
3437
3439
  return /* @__PURE__ */ jsx48(TooltipProvider, { children });
3438
3440
  };
3439
3441
 
3440
- // src/render/column/build-column/index.tsx
3442
+ // src/components/title/index.tsx
3441
3443
  import { jsx as jsx49 } from "react/jsx-runtime";
3444
+ var Title = (props) => {
3445
+ return /* @__PURE__ */ jsx49("div", { className: cn2("text-lg font-bold", props.className), children: props.children });
3446
+ };
3447
+
3448
+ // src/render/column/build-column/index.tsx
3449
+ import { jsx as jsx50 } from "react/jsx-runtime";
3442
3450
  var buildColumn = () => (props) => {
3443
3451
  const { key, label, render } = props;
3444
3452
  return {
3445
3453
  accessorKey: key,
3446
- header: () => /* @__PURE__ */ jsx49(TableHeaderText, { text: label }),
3454
+ header: () => /* @__PURE__ */ jsx50(TableHeaderText, { text: label }),
3447
3455
  cell: ({ row }) => {
3448
3456
  const value = row.original[key];
3449
- return render ? render(value, row.original) : /* @__PURE__ */ jsx49(TableText, { text: String(value ?? "") });
3457
+ return render ? render(value, row.original) : /* @__PURE__ */ jsx50(TableText, { text: String(value ?? "") });
3450
3458
  },
3451
3459
  meta: {
3452
3460
  label
@@ -3500,6 +3508,7 @@ export {
3500
3508
  TablePagination,
3501
3509
  TableText,
3502
3510
  Text,
3511
+ Title,
3503
3512
  boolToText,
3504
3513
  buildColumn,
3505
3514
  cn2 as cn,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kilnonedre/foundation",
3
- "version": "0.0.15",
3
+ "version": "0.0.17",
4
4
  "private": false,
5
5
  "description": "Kilnonedre frontend foundation package",
6
6
  "type": "module",