Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
nitrogenous authored Aug 21, 2024
2 parents fac3628 + 03023fe commit d262cbd
Show file tree
Hide file tree
Showing 87 changed files with 6,633 additions and 1,508 deletions.
6 changes: 3 additions & 3 deletions components/doc/button/theming/tailwinddoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Link from 'next/link';
export function TailwindDoc(props) {
const code = {
basic: `
const Tailwind = {
const Tailwind = {
button: {
root: ({ props, context }) => ({
className: classNames(
Expand Down Expand Up @@ -51,7 +51,7 @@ const Tailwind = {
{
'bg-transparent border-transparent': props.text && !props.plain,
'text-blue-500 dark:text-blue-400 hover:bg-blue-300/20': props.text && (props.severity === null || props.severity === 'info') && !props.plain,
'text-gray-500 dark:text-grayy-400 hover:bg-gray-300/20': props.text && props.severity === 'secondary' && !props.plain,
'text-gray-500 dark:text-gray-400 hover:bg-gray-300/20': props.text && props.severity === 'secondary' && !props.plain,
'text-green-500 dark:text-green-400 hover:bg-green-300/20': props.text && props.severity === 'success' && !props.plain,
'text-orange-500 dark:text-orange-400 hover:bg-orange-300/20': props.text && props.severity === 'warning' && !props.plain,
'text-purple-500 dark:text-purple-400 hover:bg-purple-300/20': props.text && props.severity === 'help' && !props.plain,
Expand Down Expand Up @@ -114,7 +114,7 @@ const Tailwind = {

const code2 = {
javascript: `
import React from 'react';
import React from 'react';
import { Button } from 'primereact/button';
export default function UnstyledDemo() {
Expand Down
46 changes: 45 additions & 1 deletion components/doc/common/apidoc/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -1270,6 +1270,13 @@
"type": "InputNumberPassThroughOptions",
"description": "Custom passthrough(pt) options for InputNumber."
},
{
"name": "inputotp",
"optional": true,
"readonly": false,
"type": "InputOtpPassThroughOptions",
"description": "Custom passthrough(pt) options for InputOtp."
},
{
"name": "inputswitch",
"optional": true,
Expand Down Expand Up @@ -23141,6 +23148,14 @@
"default": "",
"description": "Icon of the dropdown."
},
{
"name": "collapseIcon",
"optional": true,
"readonly": false,
"type": "IconType<DropdownProps>",
"default": "",
"description": "Icon of collapse action."
},
{
"name": "dataKey",
"optional": true,
Expand Down Expand Up @@ -31588,7 +31603,7 @@
"name": "input",
"optional": true,
"readonly": false,
"type": "InputTextPassThroughOptions",
"type": "InputOtpPassThroughType<HTMLAttributes<HTMLInputElement>>",
"description": "Uses to pass attributes to the Tooltip component."
},
{
Expand Down Expand Up @@ -47323,6 +47338,14 @@
"default": "0",
"description": "Active step index of stepper."
},
{
"name": "headerPosition",
"optional": true,
"readonly": false,
"type": "\"left\" | \"top\" | \"bottom\" | \"right\"",
"default": "",
"description": "Position of the stepper panel header relative to the step number."
},
{
"name": "linear",
"optional": true,
Expand Down Expand Up @@ -55984,6 +56007,27 @@
"type": "TreeTablePassThroughType<HTMLAttributes<HTMLInputElement>>",
"description": "Uses to pass attributes to the hidden input's DOM element."
},
{
"name": "row",
"optional": true,
"readonly": false,
"type": "RowPassThroughOptions",
"description": "Used to pass attributes to the Row helper components."
},
{
"name": "column",
"optional": true,
"readonly": false,
"type": "ColumnPassThroughOptions",
"description": "Used to pass attributes to the Column helper components."
},
{
"name": "tooltip",
"optional": true,
"readonly": false,
"type": "TooltipPassThroughOptions",
"description": "Uses to pass attributes tooltip's DOM element."
},
{
"name": "hooks",
"optional": true,
Expand Down
77 changes: 77 additions & 0 deletions components/doc/iconfield/theming/tailwinddoc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
import { DocSectionCode } from '@/components/doc/common/docsectioncode';
import { DocSectionText } from '@/components/doc/common/docsectiontext';
import Link from 'next/link';

export function TailwindDoc(props) {
const code = {
basic: `
const Tailwind = {
iconfield: {
root: {
className: classNames('relative')
}
},
inputicon: {
root: ({ context }) => ({
className: classNames('absolute top-1/2 -mt-2', {
'left-2': context.iconPosition === 'left',
'right-2': context.iconPosition === 'right'
})
})
},
// For each input wrapped with IconField you will need to add styling.
// The following is an example for InputText
inputtext: {
root: ({ props, context }) => ({
className: classNames(
// Extend the root stylings with the following:
{
'pl-8': context.iconPosition === 'left',
'pr-8': props.iconPosition === 'right'
}
)
})
},
}
`
};

const code2 = {
javascript: `
import React from 'react';
import { IconField } from 'primereact/iconfield';
import { InputIcon } from 'primereact/inputicon';
import { InputText } from 'primereact/inputtext';
export default function BasicDemo() {
return (
<div className="flex gap-3">
<IconField iconPosition="left">
<InputIcon className="pi pi-search"> </InputIcon>
<InputText placeholder="Search" />
</IconField>
<IconField>
<InputIcon className="pi pi-spin pi-spinner"> </InputIcon>
<InputText />
</IconField>
</div>
)
}
`
};

return (
<>
<DocSectionText {...props}>
<p>
PrimeReact offers a built-in Tailwind theme to get you started quickly. The default values related to the component are displayed below. The component can easily be styled with your own design based on Tailwind utilities, see the{' '}
<Link href="/tailwind">Tailwind Customization</Link> section for an example.
</p>
<DocSectionCode code={code} hideToggleCode import hideStackBlitz />
<p>A playground sample with the pre-built Tailwind theme.</p>
<DocSectionCode code={code2} embedded />
</DocSectionText>
</>
);
}
55 changes: 55 additions & 0 deletions components/doc/inputotp/theming/tailwinddoc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import { DocSectionCode } from '@/components/doc/common/docsectioncode';
import { DocSectionText } from '@/components/doc/common/docsectiontext';
import Link from 'next/link';

export function TailwindDoc(props) {
const code = {
basic: `
const Tailwind = {
inputotp: {
root: { className: 'flex items-center gap-2' },
input: {
root: {
className: classNames(
'box-border text-center w-10 h-11 p-3 text-slate-900 border border-gray-300 rounded-lg transition-all duration-200',
'hover:border-cyan-500',
'focus:border-cyan-500 focus:shadow-[0_0_0_0.2rem_#a5f3fc] focus:outline-0 focus:outline-offset-0'
)
}
}
}
}
`
};

const code2 = {
javascript: `
import React, { useState } from 'react';
import { InputOtp } from 'primereact/inputotp';
export default function BasicDemo() {
const [token, setTokens] = useState();
return (
<div className="card flex justify-content-center">
<InputOtp value={token} onChange={(e) => setTokens(e.value)}/>
</div>
);
}
`
};

return (
<>
<DocSectionText {...props}>
<p>
PrimeReact offers a built-in Tailwind theme to get you started quickly. The default values related to the component are displayed below. The component can easily be styled with your own design based on Tailwind utilities, see the{' '}
<Link href="/tailwind">Tailwind Customization</Link> section for an example.
</p>
<DocSectionCode code={code} hideToggleCode import hideStackBlitz />
<p>A playground sample with the pre-built Tailwind theme.</p>
<DocSectionCode code={code2} embedded />
</DocSectionText>
</>
);
}
7 changes: 6 additions & 1 deletion components/doc/radiobutton/theming/tailwinddoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ const Tailwind = {
root: {
className: classNames('relative inline-flex cursor-pointer select-none align-bottom', 'w-6 h-6')
},
input: ({ props }) => ({
input: {
className: classNames(
'absolute appearance-none top-0 left-0 size-full p-0 m-0 opacity-0 z-10 outline-none cursor-pointer'
),
},
box: ({ props }) => ({
className: classNames(
'flex justify-center items-center',
'border-2 w-6 h-6 text-gray-700 rounded-full transition duration-200 ease-in-out',
Expand Down
Loading

0 comments on commit d262cbd

Please sign in to comment.