idea-react 3.0.0-beta.5 → 3.0.0-rc.0
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/AGENTS.md +5 -3
- package/ReadMe.md +71 -65
- package/dist/index.d.mts +894 -929
- package/dist/index.d.ts +894 -929
- package/dist/index.js +16 -16
- package/dist/index.mjs +15 -15
- package/dist/style.css +2 -2
- package/package.json +3 -7
- package/source/{Accordion.tsx → Base/Accordion.tsx} +2 -2
- package/source/{Alert.tsx → Base/Alert.tsx} +1 -1
- package/source/{Avatar.tsx → Base/Avatar.tsx} +1 -1
- package/source/{Badge.tsx → Base/Badge.tsx} +1 -1
- package/source/{Breadcrumb.tsx → Base/Breadcrumb.tsx} +1 -1
- package/source/{Button.tsx → Base/Button.tsx} +1 -1
- package/source/{ButtonGroup.tsx → Base/ButtonGroup.tsx} +1 -1
- package/source/{Card.tsx → Base/Card.tsx} +1 -1
- package/source/{Carousel → Base/Carousel}/index.tsx +2 -2
- package/source/{CloseButton.tsx → Base/CloseButton.tsx} +1 -1
- package/source/{Collapse.tsx → Base/Collapse.tsx} +1 -1
- package/source/{Drawer.tsx → Base/Drawer.tsx} +2 -2
- package/source/{ListGroup.tsx → Base/ListGroup.tsx} +2 -2
- package/source/{Menu.tsx → Base/Menu.tsx} +4 -4
- package/source/{NativeDialog → Base/NativeDialog}/index.tsx +2 -2
- package/source/{Nav.tsx → Base/Nav.tsx} +2 -1
- package/source/{NavOverflow → Base/NavOverflow}/index.tsx +2 -2
- package/source/{Navbar.tsx → Base/Navbar.tsx} +1 -1
- package/source/{Pagination.tsx → Base/Pagination.tsx} +1 -1
- package/source/{Placeholder.tsx → Base/Placeholder.tsx} +1 -1
- package/source/{Popover.tsx → Base/Popover.tsx} +6 -2
- package/source/{Progress → Base/Progress}/index.tsx +1 -1
- package/source/{ScrollSpy → Base/ScrollSpy}/index.tsx +1 -1
- package/source/{Spinner.tsx → Base/Spinner.tsx} +2 -2
- package/source/{Stack.tsx → Base/Stack.tsx} +1 -1
- package/source/{Stepper.tsx → Base/Stepper.tsx} +2 -2
- package/source/{Tab.tsx → Base/Tab.tsx} +60 -47
- package/source/{Toast.tsx → Base/Toast.tsx} +1 -1
- package/source/{ToggleButton.tsx → Base/ToggleButton.tsx} +2 -2
- package/source/{Toggler.tsx → Base/Toggler.tsx} +1 -1
- package/source/{Tooltip.tsx → Base/Tooltip.tsx} +6 -2
- package/source/Base/index.ts +31 -0
- package/source/Content/Images.tsx +29 -0
- package/source/{Table.tsx → Content/Tables.tsx} +2 -2
- package/source/Content/index.ts +2 -0
- package/source/Extension/ClickBoundary.tsx +1 -1
- package/source/Extension/CodeBlock.tsx +1 -1
- package/source/Extension/Countdown.tsx +1 -1
- package/source/Extension/HorizontalMarquee/index.tsx +1 -1
- package/source/Extension/Icon.tsx +1 -1
- package/source/Extension/Loading.tsx +2 -2
- package/source/Extension/MarkdownView.tsx +23 -0
- package/source/Extension/MonthCalendar.tsx +4 -4
- package/source/Extension/Nameplate.tsx +1 -1
- package/source/Extension/OverlayBox.tsx +9 -4
- package/source/Extension/PageNav.tsx +2 -2
- package/source/Extension/ScrollNav/Scroller.tsx +1 -1
- package/source/Extension/ScrollNav/index.tsx +2 -2
- package/source/Extension/ShareBox.tsx +1 -1
- package/source/Extension/SpinnerButton.tsx +3 -3
- package/source/Extension/TableSpinner.tsx +2 -2
- package/source/Extension/TextTruncate/index.tsx +1 -1
- package/source/Extension/Time.tsx +1 -1
- package/source/Extension/TimeDistance.tsx +1 -1
- package/source/Extension/Timeline/index.tsx +2 -2
- package/source/Extension/TypeEcho/Content.tsx +1 -1
- package/source/Extension/TypeEcho/index.tsx +1 -1
- package/source/Extension/UserRank/Address.tsx +1 -1
- package/source/Extension/UserRank/index.tsx +5 -5
- package/source/Extension/VerticalMarquee/index.tsx +1 -1
- package/source/Extension/ZodiacBar.tsx +1 -1
- package/source/Extension/index.ts +1 -3
- package/source/Form/Adorn.tsx +1 -1
- package/source/Form/Checkbox.tsx +2 -2
- package/source/Form/{Chips.tsx → Chip.tsx} +4 -11
- package/source/Form/ChipInput.tsx +2 -2
- package/source/Form/Combobox.tsx +2 -2
- package/source/Form/Control.tsx +1 -1
- package/source/Form/DatePicker.tsx +2 -2
- package/source/Form/Feedback.tsx +1 -1
- package/source/Form/FloatingLabel.tsx +1 -1
- package/source/Form/InputGroup.tsx +3 -3
- package/source/Form/OTP.tsx +1 -1
- package/source/Form/Primitives.tsx +8 -1
- package/source/Form/Radio.tsx +2 -2
- package/source/Form/Range.tsx +2 -2
- package/source/Form/Switch.tsx +2 -2
- package/source/Form/index.ts +1 -1
- package/source/{Overlay.ts → Helper/Overlay.ts} +1 -1
- package/source/{color.ts → Helper/color.ts} +1 -1
- package/source/Helper/index.ts +4 -0
- package/source/{Grid.tsx → Layout/Grid.tsx} +1 -1
- package/source/Layout/index.ts +1 -0
- package/source/index.ts +4 -38
- package/source/Extension/Editor.tsx +0 -78
- package/source/Extension/EditorHTML.tsx +0 -20
- package/source/Extension/Select.tsx +0 -128
- package/source/Image.tsx +0 -19
- /package/source/{Carousel → Base/Carousel}/model.ts +0 -0
- /package/source/{Carousel → Base/Carousel}/scroll.ts +0 -0
- /package/source/{Carousel → Base/Carousel}/style.module.css +0 -0
- /package/source/{NativeDialog → Base/NativeDialog}/style.module.css +0 -0
- /package/source/{NavOverflow → Base/NavOverflow}/model.ts +0 -0
- /package/source/{ScrollSpy → Base/ScrollSpy}/model.ts +0 -0
- /package/source/{Polymorphic.ts → Helper/Polymorphic.ts} +0 -0
- /package/source/{animate.ts → Helper/animate.ts} +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import classNames from 'classnames';
|
|
2
2
|
import { ComponentPropsWithRef } from 'react';
|
|
3
3
|
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
4
|
+
import { polymorphic } from '../Helper/Polymorphic';
|
|
5
|
+
import type { Breakpoint } from '../Layout/Grid';
|
|
6
6
|
|
|
7
7
|
export interface TableProps extends ComponentPropsWithRef<'table'> {
|
|
8
8
|
striped?: boolean;
|
|
@@ -13,7 +13,7 @@ import reactElementToJSXString from 'react-element-to-jsx-string';
|
|
|
13
13
|
import { createHighlighterCoreSync, ShikiTransformer } from 'shiki/core';
|
|
14
14
|
import { createJavaScriptRegexEngine } from 'shiki/engine/javascript';
|
|
15
15
|
|
|
16
|
-
import { polymorphic } from '../Polymorphic';
|
|
16
|
+
import { polymorphic } from '../Helper/Polymorphic';
|
|
17
17
|
|
|
18
18
|
const highlighter = createHighlighterCoreSync({
|
|
19
19
|
themes: [githubLight, githubDark],
|
|
@@ -6,7 +6,7 @@ import { ObservedComponent, reaction } from 'mobx-react-helper';
|
|
|
6
6
|
import { ElementType, HTMLAttributes } from 'react';
|
|
7
7
|
import { Second, TimeData } from 'web-utility';
|
|
8
8
|
|
|
9
|
-
import { AsProps, PolymorphicClassProps } from '../Polymorphic';
|
|
9
|
+
import { AsProps, PolymorphicClassProps } from '../Helper/Polymorphic';
|
|
10
10
|
|
|
11
11
|
export interface TimeUnit {
|
|
12
12
|
scale: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'react';
|
|
2
2
|
|
|
3
|
-
import { polymorphic } from '../../Polymorphic';
|
|
3
|
+
import { polymorphic } from '../../Helper/Polymorphic';
|
|
4
4
|
import * as style from './index.module.less';
|
|
5
5
|
|
|
6
6
|
export type HorizontalMarqueeProps = HTMLAttributes<HTMLDivElement> &
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import classNames from 'classnames';
|
|
2
2
|
import { ComponentPropsWithRef } from 'react';
|
|
3
3
|
|
|
4
|
-
import { polymorphic } from '../Polymorphic';
|
|
4
|
+
import { polymorphic } from '../Helper/Polymorphic';
|
|
5
5
|
|
|
6
6
|
export type IconProps = ComponentPropsWithRef<'span'> & {
|
|
7
7
|
name: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'react';
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { Spinner } from '../Base/Spinner';
|
|
4
|
+
import { polymorphic } from '../Helper/Polymorphic';
|
|
5
5
|
|
|
6
6
|
export interface LoadingProps extends HTMLAttributes<HTMLDivElement> {
|
|
7
7
|
opacity?: number;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import classNames from 'classnames';
|
|
2
|
+
import { marked } from 'marked';
|
|
3
|
+
import { ComponentPropsWithRef } from 'react';
|
|
4
|
+
|
|
5
|
+
import { polymorphic } from '../Helper/Polymorphic';
|
|
6
|
+
|
|
7
|
+
export type MarkdownViewProps = Omit<
|
|
8
|
+
ComponentPropsWithRef<'article'>,
|
|
9
|
+
'children' | 'dangerouslySetInnerHTML'
|
|
10
|
+
> & {
|
|
11
|
+
children: string;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export const MarkdownView = polymorphic<MarkdownViewProps>(
|
|
15
|
+
({ as: Root = 'article', className, children, ...props }) => (
|
|
16
|
+
<Root
|
|
17
|
+
{...props}
|
|
18
|
+
className={classNames('markdown-body', className)}
|
|
19
|
+
dangerouslySetInnerHTML={{ __html: marked(children, { async: false }) }}
|
|
20
|
+
/>
|
|
21
|
+
)
|
|
22
|
+
);
|
|
23
|
+
MarkdownView.displayName = 'MarkdownView';
|
|
@@ -7,10 +7,10 @@ import { ObservedComponent } from 'mobx-react-helper';
|
|
|
7
7
|
import { ElementType, HTMLAttributes, MouseEvent, ReactNode } from 'react';
|
|
8
8
|
import { changeMonth, Day, formatDate, splitArray, TimeData } from 'web-utility';
|
|
9
9
|
|
|
10
|
-
import { Badge } from '../Badge';
|
|
11
|
-
import { Button, type ComponentTheme } from '../Button';
|
|
12
|
-
import { text2color } from '../color';
|
|
13
|
-
import { AsProps, PolymorphicClassProps } from '../Polymorphic';
|
|
10
|
+
import { Badge } from '../Base/Badge';
|
|
11
|
+
import { Button, type ComponentTheme } from '../Base/Button';
|
|
12
|
+
import { text2color } from '../Helper/color';
|
|
13
|
+
import { AsProps, PolymorphicClassProps } from '../Helper/Polymorphic';
|
|
14
14
|
import { OverlayBox } from './OverlayBox';
|
|
15
15
|
|
|
16
16
|
export interface DateData {
|
|
@@ -19,10 +19,15 @@ import {
|
|
|
19
19
|
import { createPortal } from 'react-dom';
|
|
20
20
|
import { uniqueID } from 'web-utility';
|
|
21
21
|
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
|
|
22
|
+
import { Popover } from '../Base/Popover';
|
|
23
|
+
import { Tooltip } from '../Base/Tooltip';
|
|
24
|
+
import {
|
|
25
|
+
FloatingOptions,
|
|
26
|
+
FloatingPosition,
|
|
27
|
+
OverlayContainer,
|
|
28
|
+
OverlayPlacement
|
|
29
|
+
} from '../Helper/Overlay';
|
|
30
|
+
import { AsProps, PolymorphicClassProps } from '../Helper/Polymorphic';
|
|
26
31
|
|
|
27
32
|
export type OverlayTrigger = 'click' | 'focus' | 'hover';
|
|
28
33
|
|
|
@@ -6,8 +6,8 @@ import { observer } from 'mobx-react';
|
|
|
6
6
|
import { Component, ElementType } from 'react';
|
|
7
7
|
import { scrollTo, uniqueID } from 'web-utility';
|
|
8
8
|
|
|
9
|
-
import { Nav, NavLink, NavProps } from '../Nav';
|
|
10
|
-
import { AsProps, PolymorphicClassProps } from '../Polymorphic';
|
|
9
|
+
import { Nav, NavLink, NavProps } from '../Base/Nav';
|
|
10
|
+
import { AsProps, PolymorphicClassProps } from '../Helper/Polymorphic';
|
|
11
11
|
|
|
12
12
|
const HeadingSelector = Array.from({ length: 6 }, (_, index) => `h${index + 1}`).join(',');
|
|
13
13
|
|
|
@@ -4,7 +4,7 @@ import { action, computed, observable } from 'mobx';
|
|
|
4
4
|
import { observer } from 'mobx-react';
|
|
5
5
|
import { Component, createRef, ElementType, ReactNode, Ref } from 'react';
|
|
6
6
|
|
|
7
|
-
import { AsProps, PolymorphicClassProps } from '../../Polymorphic';
|
|
7
|
+
import { AsProps, PolymorphicClassProps } from '../../Helper/Polymorphic';
|
|
8
8
|
import { Icon } from '../Icon';
|
|
9
9
|
import * as style from './index.module.less';
|
|
10
10
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ElementType } from 'react';
|
|
2
2
|
|
|
3
|
-
import { Nav, NavProps } from '../../Nav';
|
|
4
|
-
import { polymorphic } from '../../Polymorphic';
|
|
3
|
+
import { Nav, NavProps } from '../../Base/Nav';
|
|
4
|
+
import { polymorphic } from '../../Helper/Polymorphic';
|
|
5
5
|
import { ScrollNavScroller } from './Scroller';
|
|
6
6
|
|
|
7
7
|
export type ScrollNavProps = NavProps;
|
|
@@ -6,7 +6,7 @@ import { observer } from 'mobx-react';
|
|
|
6
6
|
import { Component, createRef, HTMLAttributes, MouseEvent } from 'react';
|
|
7
7
|
import { blobOf } from 'web-utility';
|
|
8
8
|
|
|
9
|
-
import { Image } from '../
|
|
9
|
+
import { Image } from '../Content/Images';
|
|
10
10
|
import { Loading } from './Loading';
|
|
11
11
|
|
|
12
12
|
export async function elementToImage(element: HTMLElement, type?: string, quality?: number) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Button, ButtonProps } from '../Button';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { Button, ButtonProps } from '../Base/Button';
|
|
2
|
+
import { Spinner, SpinnerProps } from '../Base/Spinner';
|
|
3
|
+
import { polymorphic } from '../Helper/Polymorphic';
|
|
4
4
|
|
|
5
5
|
export type SpinnerButtonProps = ButtonProps &
|
|
6
6
|
Pick<SpinnerProps, 'animation'> & {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'react';
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { Spinner, SpinnerProps } from '../Base/Spinner';
|
|
4
|
+
import { polymorphic } from '../Helper/Polymorphic';
|
|
5
5
|
|
|
6
6
|
export interface TableSpinnerProps
|
|
7
7
|
extends
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
|
|
3
|
-
import { polymorphic } from '../../Polymorphic';
|
|
3
|
+
import { polymorphic } from '../../Helper/Polymorphic';
|
|
4
4
|
import { TextTruncateContent } from './Content';
|
|
5
5
|
|
|
6
6
|
export interface TextTruncateProps extends HTMLAttributes<HTMLDivElement> {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TimeHTMLAttributes } from 'react';
|
|
2
2
|
import { formatDate, TimeData } from 'web-utility';
|
|
3
3
|
|
|
4
|
-
import { polymorphic } from '../Polymorphic';
|
|
4
|
+
import { polymorphic } from '../Helper/Polymorphic';
|
|
5
5
|
|
|
6
6
|
export interface TimeProps extends Omit<TimeHTMLAttributes<HTMLTimeElement>, 'dateTime'> {
|
|
7
7
|
dateTime: TimeData;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'react';
|
|
2
2
|
import { diffTime, TimeData } from 'web-utility';
|
|
3
3
|
|
|
4
|
-
import { polymorphic } from '../Polymorphic';
|
|
4
|
+
import { polymorphic } from '../Helper/Polymorphic';
|
|
5
5
|
|
|
6
6
|
export interface TimeDistanceProps extends HTMLAttributes<HTMLTimeElement> {
|
|
7
7
|
date: TimeData;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'react';
|
|
2
2
|
import { TimeData } from 'web-utility';
|
|
3
3
|
|
|
4
|
-
import { Card, CardBody, CardText, CardTitle } from '../../Card';
|
|
5
|
-
import { polymorphic } from '../../Polymorphic';
|
|
4
|
+
import { Card, CardBody, CardText, CardTitle } from '../../Base/Card';
|
|
5
|
+
import { polymorphic } from '../../Helper/Polymorphic';
|
|
6
6
|
import { Nameplate, NameplateProps } from '../Nameplate';
|
|
7
7
|
import { Time } from '../Time';
|
|
8
8
|
import * as styles from './index.module.less';
|
|
@@ -6,7 +6,7 @@ import { observer } from 'mobx-react';
|
|
|
6
6
|
import { Component, ElementType, HTMLAttributes, Ref, RefCallback } from 'react';
|
|
7
7
|
import { sleep } from 'web-utility';
|
|
8
8
|
|
|
9
|
-
import { AsProps, PolymorphicClassProps } from '../../Polymorphic';
|
|
9
|
+
import { AsProps, PolymorphicClassProps } from '../../Helper/Polymorphic';
|
|
10
10
|
|
|
11
11
|
export interface TypeEchoContentProps extends Omit<HTMLAttributes<HTMLPreElement>, 'children'> {
|
|
12
12
|
text: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ComponentPropsWithRef, ElementType } from 'react';
|
|
2
2
|
|
|
3
|
-
import { polymorphic } from '../../Polymorphic';
|
|
3
|
+
import { polymorphic } from '../../Helper/Polymorphic';
|
|
4
4
|
import { TypeEchoContent } from './Content';
|
|
5
5
|
|
|
6
6
|
export interface TypeEchoProps extends ComponentPropsWithRef<'pre'> {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'react';
|
|
2
2
|
|
|
3
|
-
import { Badge } from '../../Badge';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { polymorphic } from '../../Polymorphic';
|
|
7
|
-
import {
|
|
3
|
+
import { Badge } from '../../Base/Badge';
|
|
4
|
+
import { Image } from '../../Content/Images';
|
|
5
|
+
import { Table } from '../../Content/Tables';
|
|
6
|
+
import { polymorphic } from '../../Helper/Polymorphic';
|
|
7
|
+
import { Col, Container, Row } from '../../Layout/Grid';
|
|
8
8
|
import { UserAddress, UserAddressProps } from './Address';
|
|
9
9
|
import * as style from './index.module.less';
|
|
10
10
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'react';
|
|
2
2
|
|
|
3
|
-
import { polymorphic } from '../../Polymorphic';
|
|
3
|
+
import { polymorphic } from '../../Helper/Polymorphic';
|
|
4
4
|
import * as style from './index.module.less';
|
|
5
5
|
|
|
6
6
|
export interface VerticalMarqueeProps extends HTMLAttributes<HTMLDivElement> {
|
|
@@ -2,18 +2,16 @@ export * from './ClickBoundary';
|
|
|
2
2
|
export * from './CodeBlock';
|
|
3
3
|
export * from './Countdown';
|
|
4
4
|
export * from './Dialog';
|
|
5
|
-
export * from './Editor';
|
|
6
|
-
export * from './EditorHTML';
|
|
7
5
|
export * from './HorizontalMarquee';
|
|
8
6
|
export * from './Icon';
|
|
9
7
|
export * from './LiveTSX';
|
|
10
8
|
export * from './Loading';
|
|
9
|
+
export * from './MarkdownView';
|
|
11
10
|
export * from './MonthCalendar';
|
|
12
11
|
export * from './Nameplate';
|
|
13
12
|
export * from './OverlayBox';
|
|
14
13
|
export * from './PageNav';
|
|
15
14
|
export * from './ScrollNav';
|
|
16
|
-
export * from './Select';
|
|
17
15
|
export * from './ShareBox';
|
|
18
16
|
export * from './SpinnerButton';
|
|
19
17
|
export * from './TableSpinner';
|
package/source/Form/Adorn.tsx
CHANGED
|
@@ -2,7 +2,7 @@ import classNames from 'classnames';
|
|
|
2
2
|
import { ComponentPropsWithRef } from 'react';
|
|
3
3
|
|
|
4
4
|
import { Icon, IconProps } from '../Extension/Icon';
|
|
5
|
-
import { polymorphic } from '../Polymorphic';
|
|
5
|
+
import { polymorphic } from '../Helper/Polymorphic';
|
|
6
6
|
import { FormValidationProps } from './Primitives';
|
|
7
7
|
|
|
8
8
|
export type FormAdornmentProps = Omit<ComponentPropsWithRef<'label'>, 'htmlFor'> &
|
package/source/Form/Checkbox.tsx
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import { Component, ComponentPropsWithoutRef, forwardRef, Ref } from 'react';
|
|
5
5
|
|
|
6
|
-
import type { ComponentTheme } from '../Button';
|
|
7
|
-
import { AsProps, polymorphic } from '../Polymorphic';
|
|
6
|
+
import type { ComponentTheme } from '../Base/Button';
|
|
7
|
+
import { AsProps, polymorphic } from '../Helper/Polymorphic';
|
|
8
8
|
import { FormValidationProps } from './Primitives';
|
|
9
9
|
|
|
10
10
|
export type CheckboxProps = Omit<ComponentPropsWithoutRef<'input'>, 'type' | 'size'> &
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import classNames from 'classnames';
|
|
2
2
|
import { ComponentPropsWithRef } from 'react';
|
|
3
3
|
|
|
4
|
-
import { ComponentTheme } from '../Button';
|
|
4
|
+
import { ComponentTheme } from '../Base/Button';
|
|
5
5
|
import { Icon, IconProps } from '../Extension/Icon';
|
|
6
|
-
import { polymorphic } from '../Polymorphic';
|
|
6
|
+
import { polymorphic } from '../Helper/Polymorphic';
|
|
7
7
|
|
|
8
8
|
export type ChipProps = ComponentPropsWithRef<'button'> & {
|
|
9
9
|
active?: boolean;
|
|
@@ -11,11 +11,11 @@ export type ChipProps = ComponentPropsWithRef<'button'> & {
|
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
export const Chip = polymorphic<ChipProps>(
|
|
14
|
-
({ as: Root = 'button', className, active, theme, ...props }) => (
|
|
14
|
+
({ as: Root = 'button', className, active, theme, type = 'button', ...props }) => (
|
|
15
15
|
<Root
|
|
16
16
|
{...props}
|
|
17
17
|
className={classNames('chip', { active }, theme && `theme-${theme}`, className)}
|
|
18
|
-
type=
|
|
18
|
+
type={Root === 'button' ? type : undefined}
|
|
19
19
|
aria-pressed={active}
|
|
20
20
|
/>
|
|
21
21
|
)
|
|
@@ -62,10 +62,3 @@ export const ChipToken = polymorphic<ChipTokenProps>(
|
|
|
62
62
|
)
|
|
63
63
|
);
|
|
64
64
|
ChipToken.displayName = 'ChipToken';
|
|
65
|
-
|
|
66
|
-
export const ChipInputLabel = polymorphic<ComponentPropsWithRef<'label'>>(
|
|
67
|
-
({ as: Root = 'label', className, ...props }) => (
|
|
68
|
-
<Root {...props} className={classNames('chip-input-label', className)} />
|
|
69
|
-
)
|
|
70
|
-
);
|
|
71
|
-
ChipInputLabel.displayName = 'ChipInputLabel';
|
|
@@ -5,9 +5,9 @@ import classNames from 'classnames';
|
|
|
5
5
|
import { ComponentPropsWithoutRef, forwardRef, Ref } from 'react';
|
|
6
6
|
import { renderToStaticMarkup } from 'react-dom/server';
|
|
7
7
|
|
|
8
|
-
import { ComponentTheme } from '../Button';
|
|
8
|
+
import { ComponentTheme } from '../Base/Button';
|
|
9
9
|
import { Icon } from '../Extension/Icon';
|
|
10
|
-
import { AsProps, polymorphic } from '../Polymorphic';
|
|
10
|
+
import { AsProps, polymorphic } from '../Helper/Polymorphic';
|
|
11
11
|
import { FormPlugin } from './Plugin';
|
|
12
12
|
import { FormValidationProps } from './Primitives';
|
|
13
13
|
|
package/source/Form/Combobox.tsx
CHANGED
|
@@ -17,9 +17,9 @@ import {
|
|
|
17
17
|
ReactNode
|
|
18
18
|
} from 'react';
|
|
19
19
|
|
|
20
|
+
import { Menu, MenuHeader, MenuItemContent, MenuItemDescription } from '../Base/Menu';
|
|
20
21
|
import { Icon } from '../Extension/Icon';
|
|
21
|
-
import {
|
|
22
|
-
import { AsProps, polymorphic, PolymorphicClassProps } from '../Polymorphic';
|
|
22
|
+
import { AsProps, polymorphic, PolymorphicClassProps } from '../Helper/Polymorphic';
|
|
23
23
|
import { FormValidationProps } from './Primitives';
|
|
24
24
|
|
|
25
25
|
export interface ComboboxOptionProps extends ComponentPropsWithRef<'button'> {
|
package/source/Form/Control.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import classNames from 'classnames';
|
|
2
2
|
import { ComponentPropsWithRef } from 'react';
|
|
3
3
|
|
|
4
|
-
import { polymorphic } from '../Polymorphic';
|
|
4
|
+
import { polymorphic } from '../Helper/Polymorphic';
|
|
5
5
|
import { FormValidationProps } from './Primitives';
|
|
6
6
|
|
|
7
7
|
const CONTROL_SIZES = {
|
|
@@ -4,9 +4,9 @@ import Datepicker, { type DatepickerConfig } from 'bootstrap/js/src/datepicker.j
|
|
|
4
4
|
import classNames from 'classnames';
|
|
5
5
|
import { ComponentPropsWithoutRef, forwardRef, Ref } from 'react';
|
|
6
6
|
|
|
7
|
-
import { Button, ButtonProps } from '../Button';
|
|
7
|
+
import { Button, ButtonProps } from '../Base/Button';
|
|
8
8
|
import { Icon } from '../Extension/Icon';
|
|
9
|
-
import { AsProps, polymorphic, PolymorphicComponent } from '../Polymorphic';
|
|
9
|
+
import { AsProps, polymorphic, PolymorphicComponent } from '../Helper/Polymorphic';
|
|
10
10
|
import { FormPlugin } from './Plugin';
|
|
11
11
|
import { FormValidationProps } from './Primitives';
|
|
12
12
|
|
package/source/Form/Feedback.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import classNames from 'classnames';
|
|
2
2
|
import { ComponentPropsWithRef } from 'react';
|
|
3
3
|
|
|
4
|
-
import { polymorphic } from '../Polymorphic';
|
|
4
|
+
import { polymorphic } from '../Helper/Polymorphic';
|
|
5
5
|
|
|
6
6
|
export type FormTextProps = ComponentPropsWithRef<'small'> & {
|
|
7
7
|
block?: boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import classNames from 'classnames';
|
|
2
2
|
import { Children, ComponentPropsWithRef, isValidElement, ReactNode } from 'react';
|
|
3
3
|
|
|
4
|
-
import { polymorphic } from '../Polymorphic';
|
|
4
|
+
import { polymorphic } from '../Helper/Polymorphic';
|
|
5
5
|
import { FormLabel } from './Primitives';
|
|
6
6
|
|
|
7
7
|
export type FormFloatingLabelProps = ComponentPropsWithRef<'div'> & {
|
|
@@ -12,9 +12,9 @@ import {
|
|
|
12
12
|
ReactElement
|
|
13
13
|
} from 'react';
|
|
14
14
|
|
|
15
|
-
import { Button, ButtonProps } from '../Button';
|
|
16
|
-
import { Menu, MenuProps } from '../Menu';
|
|
17
|
-
import { polymorphic } from '../Polymorphic';
|
|
15
|
+
import { Button, ButtonProps } from '../Base/Button';
|
|
16
|
+
import { Menu, MenuProps } from '../Base/Menu';
|
|
17
|
+
import { polymorphic } from '../Helper/Polymorphic';
|
|
18
18
|
|
|
19
19
|
export type InputGroupProps = ComponentPropsWithRef<'div'> & {
|
|
20
20
|
size?: 'sm' | 'lg';
|
package/source/Form/OTP.tsx
CHANGED
|
@@ -4,7 +4,7 @@ import type OtpInput from 'bootstrap/js/src/otp-input.js';
|
|
|
4
4
|
import classNames from 'classnames';
|
|
5
5
|
import { ComponentPropsWithoutRef, forwardRef, Ref } from 'react';
|
|
6
6
|
|
|
7
|
-
import { AsProps, polymorphic } from '../Polymorphic';
|
|
7
|
+
import { AsProps, polymorphic } from '../Helper/Polymorphic';
|
|
8
8
|
import { FormPlugin } from './Plugin';
|
|
9
9
|
import { FormValidationProps } from './Primitives';
|
|
10
10
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import classNames from 'classnames';
|
|
2
2
|
import { ComponentPropsWithRef } from 'react';
|
|
3
3
|
|
|
4
|
-
import { polymorphic } from '../Polymorphic';
|
|
4
|
+
import { polymorphic } from '../Helper/Polymorphic';
|
|
5
5
|
|
|
6
6
|
export type FormProps = ComponentPropsWithRef<'form'> & {
|
|
7
7
|
validated?: boolean;
|
|
@@ -78,6 +78,13 @@ export const FormLabel = polymorphic<FormLabelProps>(
|
|
|
78
78
|
);
|
|
79
79
|
FormLabel.displayName = 'FormLabel';
|
|
80
80
|
|
|
81
|
+
export const ChipInputLabel = polymorphic<ComponentPropsWithRef<'label'>>(
|
|
82
|
+
({ as: Root = 'label', className, ...props }) => (
|
|
83
|
+
<Root {...props} className={classNames('chip-input-label', className)} />
|
|
84
|
+
)
|
|
85
|
+
);
|
|
86
|
+
ChipInputLabel.displayName = 'ChipInputLabel';
|
|
87
|
+
|
|
81
88
|
export type FormLegendProps = ComponentPropsWithRef<'legend'> &
|
|
82
89
|
Pick<FormLabelProps, 'column' | 'controlSize'>;
|
|
83
90
|
|
package/source/Form/Radio.tsx
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import classNames from 'classnames';
|
|
2
2
|
import { ComponentPropsWithRef } from 'react';
|
|
3
3
|
|
|
4
|
-
import type { ComponentTheme } from '../Button';
|
|
5
|
-
import { polymorphic } from '../Polymorphic';
|
|
4
|
+
import type { ComponentTheme } from '../Base/Button';
|
|
5
|
+
import { polymorphic } from '../Helper/Polymorphic';
|
|
6
6
|
import { Checkbox, CheckboxProps } from './Checkbox';
|
|
7
7
|
import { FormValidationProps } from './Primitives';
|
|
8
8
|
|
package/source/Form/Range.tsx
CHANGED
|
@@ -4,8 +4,8 @@ import type Range from 'bootstrap/js/src/range.js';
|
|
|
4
4
|
import classNames from 'classnames';
|
|
5
5
|
import { ComponentPropsWithoutRef, CSSProperties, forwardRef, Ref } from 'react';
|
|
6
6
|
|
|
7
|
-
import { ComponentTheme } from '../Button';
|
|
8
|
-
import { AsProps, polymorphic } from '../Polymorphic';
|
|
7
|
+
import { ComponentTheme } from '../Base/Button';
|
|
8
|
+
import { AsProps, polymorphic } from '../Helper/Polymorphic';
|
|
9
9
|
import { FormPlugin } from './Plugin';
|
|
10
10
|
import { FormValidationProps } from './Primitives';
|
|
11
11
|
|
package/source/Form/Switch.tsx
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import classNames from 'classnames';
|
|
2
2
|
import { ComponentPropsWithRef, CSSProperties, PropsWithChildren, Ref } from 'react';
|
|
3
3
|
|
|
4
|
-
import type { ComponentTheme } from '../Button';
|
|
5
|
-
import { polymorphic } from '../Polymorphic';
|
|
4
|
+
import type { ComponentTheme } from '../Base/Button';
|
|
5
|
+
import { polymorphic } from '../Helper/Polymorphic';
|
|
6
6
|
import { splitInputProps } from './inputProps';
|
|
7
7
|
import { FormValidationProps } from './Primitives';
|
|
8
8
|
|
package/source/Form/index.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { action, observable } from 'mobx';
|
|
2
2
|
import { ComponentPropsWithRef, CSSProperties } from 'react';
|
|
3
3
|
|
|
4
|
-
import { Breakpoint } from '
|
|
4
|
+
import { Breakpoint } from '../Layout/Grid';
|
|
5
5
|
|
|
6
6
|
export type OverlayPlacement = 'top' | 'right' | 'bottom' | 'left';
|
|
7
7
|
export type FloatingPlacement = OverlayPlacement | `${OverlayPlacement}-${'start' | 'end'}`;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import classNames from 'classnames';
|
|
2
2
|
import { ComponentPropsWithRef } from 'react';
|
|
3
3
|
|
|
4
|
-
import { polymorphic } from '
|
|
4
|
+
import { polymorphic } from '../Helper/Polymorphic';
|
|
5
5
|
|
|
6
6
|
export type Breakpoint = 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
7
7
|
export type ColSize = number | 'auto';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Grid';
|