first commit
This commit is contained in:
669
src/common/ui/51-modern-default.css
Normal file
669
src/common/ui/51-modern-default.css
Normal file
File diff suppressed because one or more lines are too long
18
src/common/ui/KintonePluginAlert.tsx
Normal file
18
src/common/ui/KintonePluginAlert.tsx
Normal file
@@ -0,0 +1,18 @@
|
||||
import React from 'react';
|
||||
|
||||
import clsx from 'clsx';
|
||||
|
||||
interface KintonePluginAlertProps {
|
||||
className?: string;
|
||||
children: React.ReactNode;
|
||||
}
|
||||
|
||||
const KintonePluginAlert: React.FC<KintonePluginAlertProps> = (props) => {
|
||||
const { className, children } = props;
|
||||
return (
|
||||
<div className={clsx('kintoneplugin-alert', className)} role="alert">
|
||||
{children}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
export default KintonePluginAlert;
|
26
src/common/ui/KintonePluginButton.tsx
Normal file
26
src/common/ui/KintonePluginButton.tsx
Normal file
@@ -0,0 +1,26 @@
|
||||
import React from 'react';
|
||||
|
||||
import clsx from 'clsx';
|
||||
|
||||
interface KintonePluginButtonProps {
|
||||
className?: string;
|
||||
variant: 'normal' | 'disabled' | 'dialog-ok' | 'dialog-cancel';
|
||||
type?: 'button' | 'submit' | 'reset';
|
||||
onClick?: React.MouseEventHandler<HTMLButtonElement>;
|
||||
children: React.ReactNode;
|
||||
}
|
||||
|
||||
const KintonePluginButton: React.FC<KintonePluginButtonProps> = (props) => {
|
||||
const { className, variant, type, onClick, children } = props;
|
||||
return (
|
||||
<button
|
||||
className={clsx(`kintoneplugin-button-${variant}`, className)}
|
||||
type={type}
|
||||
onClick={onClick}
|
||||
disabled={variant === 'disabled'}
|
||||
>
|
||||
{children}
|
||||
</button>
|
||||
);
|
||||
};
|
||||
export default KintonePluginButton;
|
14
src/common/ui/KintonePluginDesc.tsx
Normal file
14
src/common/ui/KintonePluginDesc.tsx
Normal file
@@ -0,0 +1,14 @@
|
||||
import React from 'react';
|
||||
|
||||
import clsx from 'clsx';
|
||||
|
||||
interface KintonePluginDescProps {
|
||||
className?: string;
|
||||
children: React.ReactNode;
|
||||
}
|
||||
|
||||
const KintonePluginDesc: React.FC<KintonePluginDescProps> = (props) => {
|
||||
const { className, children } = props;
|
||||
return <div className={clsx('kintoneplugin-desc', className)}>{children}</div>;
|
||||
};
|
||||
export default KintonePluginDesc;
|
14
src/common/ui/KintonePluginLabel.tsx
Normal file
14
src/common/ui/KintonePluginLabel.tsx
Normal file
@@ -0,0 +1,14 @@
|
||||
import React from 'react';
|
||||
|
||||
import clsx from 'clsx';
|
||||
|
||||
interface KintonePluginLabelProps {
|
||||
className?: string;
|
||||
children: React.ReactNode;
|
||||
}
|
||||
|
||||
const KintonePluginLabel: React.FC<KintonePluginLabelProps> = (props) => {
|
||||
const { className, children } = props;
|
||||
return <div className={clsx('kintoneplugin-label', className)}>{children}</div>;
|
||||
};
|
||||
export default KintonePluginLabel;
|
14
src/common/ui/KintonePluginRequire.tsx
Normal file
14
src/common/ui/KintonePluginRequire.tsx
Normal file
@@ -0,0 +1,14 @@
|
||||
import React from 'react';
|
||||
|
||||
import clsx from 'clsx';
|
||||
|
||||
interface KintonePluginRequire {
|
||||
className?: string;
|
||||
children: React.ReactNode;
|
||||
}
|
||||
|
||||
const KintonePluginRequire: React.FC<KintonePluginRequire> = (props) => {
|
||||
const { className, children } = props;
|
||||
return <span className={clsx('kintoneplugin-require', className)}>{children}</span>;
|
||||
};
|
||||
export default KintonePluginRequire;
|
14
src/common/ui/KintonePluginRow.tsx
Normal file
14
src/common/ui/KintonePluginRow.tsx
Normal file
@@ -0,0 +1,14 @@
|
||||
import React from 'react';
|
||||
|
||||
import clsx from 'clsx';
|
||||
|
||||
interface KintonePluginRowProps {
|
||||
className?: string;
|
||||
children: React.ReactNode;
|
||||
}
|
||||
|
||||
const KintonePluginRow: React.FC<KintonePluginRowProps> = (props) => {
|
||||
const { className, children } = props;
|
||||
return <div className={clsx('kintoneplugin-row', className)}>{children}</div>;
|
||||
};
|
||||
export default KintonePluginRow;
|
38
src/common/ui/KintonePluginSelect.tsx
Normal file
38
src/common/ui/KintonePluginSelect.tsx
Normal file
@@ -0,0 +1,38 @@
|
||||
import React from 'react';
|
||||
|
||||
import clsx from 'clsx';
|
||||
|
||||
export interface KintonePluginSelectOptionData {
|
||||
key: string;
|
||||
value: string;
|
||||
label: string;
|
||||
disabled?: boolean;
|
||||
}
|
||||
|
||||
interface KintonePluginSelectProps {
|
||||
className?: string;
|
||||
defaultValue?: string;
|
||||
onChange?: (e: React.ChangeEvent<HTMLSelectElement>) => void;
|
||||
options: KintonePluginSelectOptionData[];
|
||||
}
|
||||
|
||||
const KintonePluginSelect: React.FC<KintonePluginSelectProps> = (props) => {
|
||||
const { className, defaultValue, onChange, options } = props;
|
||||
if (!options || options.length === 0) {
|
||||
return null; // Return null if no options are provided
|
||||
}
|
||||
return (
|
||||
<div className={clsx('kintoneplugin-select-outer', className)}>
|
||||
<div className="kintoneplugin-select">
|
||||
<select defaultValue={defaultValue} onChange={onChange}>
|
||||
{options.map((option) => (
|
||||
<option key={option.key} value={option.value} disabled={option.disabled}>
|
||||
{option.label}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
export default KintonePluginSelect;
|
14
src/common/ui/KintonePluginTitle.tsx
Normal file
14
src/common/ui/KintonePluginTitle.tsx
Normal file
@@ -0,0 +1,14 @@
|
||||
import React from 'react';
|
||||
|
||||
import clsx from 'clsx';
|
||||
|
||||
interface KintonePluginTitleProps {
|
||||
className?: string;
|
||||
children: React.ReactNode;
|
||||
}
|
||||
|
||||
const KintonePluginTitle: React.FC<KintonePluginTitleProps> = (props) => {
|
||||
const { className, children } = props;
|
||||
return <div className={clsx('kintoneplugin-title', className)}>{children}</div>;
|
||||
};
|
||||
export default KintonePluginTitle;
|
Reference in New Issue
Block a user