@star-insure/sdk 3.0.2 → 3.1.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/dist/components/common/Button.d.ts +2 -1
- package/dist/components/filter/Action.d.ts +3 -0
- package/dist/components/filter/Back.d.ts +4 -0
- package/dist/components/filter/Dropdown.d.ts +12 -0
- package/dist/components/filter/FilterItem.d.ts +6 -0
- package/dist/components/filter/FilterOptions.d.ts +5 -0
- package/dist/components/filter/PageHeader.d.ts +14 -0
- package/dist/components/filter/SearchBar.d.ts +7 -0
- package/dist/components/filter/index.d.ts +1 -0
- package/dist/lib/page.d.ts +19 -0
- package/dist/sdk.cjs.development.js +4 -2
- package/dist/sdk.cjs.development.js.map +1 -1
- package/dist/sdk.cjs.production.min.js +1 -1
- package/dist/sdk.cjs.production.min.js.map +1 -1
- package/dist/sdk.esm.js +4 -2
- package/dist/sdk.esm.js.map +1 -1
- package/dist/types/misc/index.d.ts +27 -0
- package/package.json +4 -1
- package/src/components/common/Button.tsx +5 -2
- package/src/components/filter/Action.tsx +30 -0
- package/src/components/filter/Back.tsx +35 -0
- package/src/components/filter/Dropdown.tsx +51 -0
- package/src/components/filter/FilterItem.tsx +318 -0
- package/src/components/filter/FilterOptions.tsx +21 -0
- package/src/components/filter/PageHeader.tsx +176 -0
- package/src/components/filter/SearchBar.tsx +105 -0
- package/src/components/filter/index.ts +1 -0
- package/src/lib/page.tsx +24 -0
- package/src/types/misc/index.ts +33 -0
|
@@ -9,6 +9,7 @@ interface Props {
|
|
|
9
9
|
children: React.ReactNode;
|
|
10
10
|
disabled?: boolean;
|
|
11
11
|
as?: 'link' | 'button' | 'a';
|
|
12
|
+
small?: boolean;
|
|
12
13
|
}
|
|
13
|
-
export default function Button({ className, href, target, onClick, type, children, status, disabled, as, }: Props): JSX.Element;
|
|
14
|
+
export default function Button({ className, href, target, onClick, type, children, status, disabled, as, small, }: Props): JSX.Element;
|
|
14
15
|
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
declare type Props = {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
onClose: Function;
|
|
5
|
+
active: boolean;
|
|
6
|
+
};
|
|
7
|
+
declare function Dropdown({ children, onClose, active }: Props): JSX.Element;
|
|
8
|
+
declare namespace Dropdown {
|
|
9
|
+
var Title: "button";
|
|
10
|
+
var Content: "form";
|
|
11
|
+
}
|
|
12
|
+
export default Dropdown;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FilterOption, TPageHeaderAction } from '../../types';
|
|
3
|
+
interface Props {
|
|
4
|
+
title: string;
|
|
5
|
+
search?: string;
|
|
6
|
+
className?: string;
|
|
7
|
+
innerClassName?: string;
|
|
8
|
+
back?: boolean | string;
|
|
9
|
+
actions?: TPageHeaderAction[];
|
|
10
|
+
backText?: string;
|
|
11
|
+
filterOptions?: FilterOption[];
|
|
12
|
+
}
|
|
13
|
+
export default function PageHeader({ title, search, className, innerClassName, back, actions, filterOptions, }: Props): JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as PageHeader } from './PageHeader';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Page, PageProps } from '@inertiajs/core';
|
|
2
|
+
import { AuthContext, Breadcrumb, Environment } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Add custom props here, that are defined in `app/Http/Middleware/HandleInertiaRequests.php`
|
|
5
|
+
*/
|
|
6
|
+
declare type CustomPageProps = {
|
|
7
|
+
env: Environment;
|
|
8
|
+
breadcrumbs: Breadcrumb[];
|
|
9
|
+
links: Record<string, string>;
|
|
10
|
+
access_token?: string;
|
|
11
|
+
impersonate_id?: number;
|
|
12
|
+
csrf_token?: string;
|
|
13
|
+
auth: AuthContext;
|
|
14
|
+
} & PageProps;
|
|
15
|
+
/**
|
|
16
|
+
* A wrapper around Inertia's usePage function that gives better type-safety
|
|
17
|
+
*/
|
|
18
|
+
export declare function usePage<T>(): Page<CustomPageProps & T>;
|
|
19
|
+
export {};
|
|
@@ -1132,8 +1132,10 @@ function Button(_ref) {
|
|
|
1132
1132
|
status = _ref$status === void 0 ? 'default' : _ref$status,
|
|
1133
1133
|
_ref$disabled = _ref.disabled,
|
|
1134
1134
|
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
1135
|
-
as = _ref.as
|
|
1136
|
-
|
|
1135
|
+
as = _ref.as,
|
|
1136
|
+
_ref$small = _ref.small,
|
|
1137
|
+
small = _ref$small === void 0 ? false : _ref$small;
|
|
1138
|
+
var baseClasses = small ? 'font-bold text-sm inline-flex items-center gap-3 justify-center text-white text-center px-3 py-1 rounded min-w-[80px] transition-all hover:opacity-75' : 'font-black inline-flex items-center gap-3 justify-center text-white text-center px-5 py-2 rounded-md min-w-[120px] transition-all hover:opacity-75';
|
|
1137
1139
|
var statusClass = status === 'primary' && 'bg-teal' || status === 'danger' && 'bg-red-500' || status === 'warning' && 'bg-yellow-400' || status === 'info' && 'bg-blue-400' || 'bg-gray-600';
|
|
1138
1140
|
var classes = (className != null ? className : '') + " " + baseClasses + " " + statusClass;
|
|
1139
1141
|
|