Skip to content

Commit

Permalink
feat(Components): add Date Components menu item (#134)
Browse files Browse the repository at this point in the history
  • Loading branch information
korvin89 authored Nov 21, 2023
1 parent 741f2bd commit cd8f803
Show file tree
Hide file tree
Showing 9 changed files with 76 additions and 3 deletions.
7 changes: 7 additions & 0 deletions src/content/components/date-components/Calendar/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import {Component} from '../../types';

export const calendarConfig: Component = {
id: 'calendar',
title: 'Calendar',
isComingSoon: true,
};
7 changes: 7 additions & 0 deletions src/content/components/date-components/DateField/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import {Component} from '../../types';

export const dateFieldConfig: Component = {
id: 'date-field',
title: 'Date Field',
isComingSoon: true,
};
7 changes: 7 additions & 0 deletions src/content/components/date-components/DatePicker/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import {Component} from '../../types';

export const datePickerConfig: Component = {
id: 'date-picker',
title: 'Date Picker',
isComingSoon: true,
};
7 changes: 7 additions & 0 deletions src/content/components/date-components/RangeCalendar/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import {Component} from '../../types';

export const rangeCalendarConfig: Component = {
id: 'range-calendar',
title: 'Range Calendar',
isComingSoon: true,
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import {Component} from '../../types';

export const relativeDateFieldConfig: Component = {
id: 'relative-date-field',
title: 'Relative Date Field',
isComingSoon: true,
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import {Component} from '../../types';

export const relativeDatePickerConfig: Component = {
id: 'relative-date-picker',
title: 'Relative Date Picker',
isComingSoon: true,
};
30 changes: 30 additions & 0 deletions src/content/components/date-components/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import {sortBy} from 'lodash';

import {getLibById} from '../../../utils';
import {Component, Lib} from '../types';

import {calendarConfig} from './Calendar';
import {dateFieldConfig} from './DateField';
import {datePickerConfig} from './DatePicker';
import {rangeCalendarConfig} from './RangeCalendar';
import {relativeDateFieldConfig} from './RelativeDateField';
import {relativeDatePickerConfig} from './RelativeDatePicker';

const {config} = getLibById('date-components');

const components: Component[] = [
calendarConfig,
dateFieldConfig,
datePickerConfig,
rangeCalendarConfig,
relativeDateFieldConfig,
relativeDatePickerConfig,
];

export const dateComponents: Lib = {
id: config.id,
title: config.title,
primary: config.primary,
description: config.description,
components: sortBy(components, 'title'),
};
6 changes: 3 additions & 3 deletions src/content/components/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// import {components} from './components';
import {Lib} from './types';
import {dateComponents} from './date-components';
import type {Lib} from './types';
import {uikit} from './uikit';

export type {SandboxType, SandboxProps, Component} from './types';

export const libs: Lib[] = [uikit /*, components*/];
export const libs: Lib[] = [uikit, dateComponents];
1 change: 1 addition & 0 deletions src/types/common.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export enum Repos {
Uikit = 'uikit',
Components = 'components',
DateComponents = 'date-components',
}

0 comments on commit cd8f803

Please sign in to comment.