Skip to content

Commit

Permalink
reorganize FluentUI component files
Browse files Browse the repository at this point in the history
  • Loading branch information
KermanX committed Jan 19, 2024
1 parent c501f0f commit e8769f4
Show file tree
Hide file tree
Showing 87 changed files with 101 additions and 675 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Content } from "refina";
import FluentUI from "../../plugin";
import styles from "./panel.styles";
import styles from "./styles";

declare module "refina" {
interface Components {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Content } from "refina";
import FluentUI from "../../plugin";
import styles from "./fButton.styles";
import styles from "./styles";
import { FButtonApperance, FButtonShape } from "./types";

declare module "refina" {
Expand Down Expand Up @@ -65,3 +65,5 @@ FluentUI.triggerComponents.fCircularButton = function (_) {
return (inner, disabled, appearance) =>
_.fButton(inner, disabled, "circular", appearance) && this.$fire();
};

export * from "./types";
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
mergeClasses,
} from "@refina/griffel";
import { createCustomFocusIndicatorStyle } from "../../focus";
import { FButtonApperance, FButtonShape } from ".";
import { FButtonApperance, FButtonShape } from "./types";

export const buttonClassNames = {
root: "fui-Button",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import "@refina/fluentui-icons/checkmark.ts";
import "@refina/fluentui-icons/square.ts";
import { DOMElementComponent, Model, valueOf, ref } from "refina";
import { DOMElementComponent, Model, ref, valueOf } from "refina";
import FluentUI from "../../plugin";
import "../fLabel";
import styles from "./fCheckbox.styles";

export type FCheckboxState = true | false | "mixed";
import styles from "./styles";
import { FCheckboxState } from "./types";

declare module "refina" {
interface Components {
Expand Down Expand Up @@ -59,3 +57,6 @@ FluentUI.triggerComponents.fCheckbox = function (_) {
);
};
};

export * from "./types";
export * from "./utils";
1 change: 1 addition & 0 deletions packages/fluentui/src/components/checkbox/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export type FCheckboxState = true | false | "mixed";
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { FCheckboxState } from "./fCheckbox";
import type { FCheckboxState } from "./types";

/**
* @returns the mixed state if any of the sources is mixed, true if any of the sources is true and none is false, false otherwise
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,10 @@ import {
valueOf,
} from "refina";
import FluentUI from "../../plugin";
import "../../positioning";
import "../fPortal";
import dropdownStyles from "./fDropdown.styles";
import { DropdownAppearance } from "./fDropdown.types";
import listboxStyles from "./listbox.styles";
import optionStyles from "./option.styles";
import dropdownStyles from "./styles";
import { FDropdownAppearance } from "./types";

/**
* enum of actions available in any type of managed dropdown control
Expand Down Expand Up @@ -144,7 +142,7 @@ declare module "refina" {
options: OptionValue[],
disabled?: boolean | boolean[],
placeholder?: string,
appearance?: DropdownAppearance,
appearance?: FDropdownAppearance,
): this is {
$ev: OptionValue;
};
Expand Down Expand Up @@ -395,3 +393,5 @@ FluentUI.triggerComponents.fUnderlineDropdown = function (_) {
this.$fire(_.$ev);
};
};

export * from "./types";
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { tokens, typographyStyles } from "@fluentui/tokens";
import { makeStyles, mergeClasses, shorthands } from "@refina/griffel";
import { DropdownAppearance } from "./fDropdown.types";
import { FDropdownAppearance } from "./types";
import { iconSizes } from "./tokens";

export const dropdownClassNames = {
Expand Down Expand Up @@ -234,7 +234,11 @@ const iconStyles = makeStyles({
});

export default {
root: (appearance: DropdownAppearance, disabled: boolean, invalid: boolean) =>
root: (
appearance: FDropdownAppearance,
disabled: boolean,
invalid: boolean,
) =>
mergeClasses(
dropdownClassNames.root,
styles.root,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export type DropdownAppearance =
export type FDropdownAppearance =
| "filled-darker"
| "filled-lighter"
| "outline"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { Content, Model, View, model, valueOf } from "refina";
import FluentUI from "../../plugin";
import "./fDialogBody";
import "./fDialogSurface";

declare module "refina" {
interface Components {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import "@refina/fluentui-icons/dismiss.js";
import { Content, Context } from "refina";
import FluentUI from "../../plugin";
import dialogActionsStyles from "./dialogActions.styles";
import dialogBodyStyles from "./dialogBody.styles";
import dialogContentStyles from "./dialogContent.styles";
import dialogTitleStyles from "./dialogTitle.styles";
import dialogActionsStyles from "./actions.styles";
import dialogBodyStyles from "./body.styles";
import dialogContentStyles from "./content.styles";
import dialogTitleStyles from "./title.styles";

export const fromCloseButtonSym = Symbol("fDialogCloseEventFromCloseButton");
export type FDialogBodyEventData =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Content } from "refina";
import FluentUI from "../../plugin";
import "../fPortal";
import dialogSurfaceStyles from "./dialogSurface.styles";
import dialogSurfaceStyles from "./styles";

declare module "refina" {
interface Components {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
SURFACE_PADDING,
SURFACE_BORDER_WIDTH,
MEDIA_QUERY_BREAKPOINT_SELECTOR,
} from "./constants";
} from "../dialogBody/constants";

export const dialogSurfaceClassNames = {
root: "fui-DialogSurface",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Content } from "refina";
import FluentUI from "../../plugin";
import styles from "./fDivider.styles";
import styles from "./styles";
import { DividerContentAlignment } from "./types";

declare module "refina" {
Expand All @@ -17,3 +17,5 @@ FluentUI.outputComponents.fDivider = function (_) {
_._div({}, _ => styles.wrapper(_) && _._div({}, inner));
};
};

export * from "./types";
2 changes: 0 additions & 2 deletions packages/fluentui/src/components/fAccordion/index.ts

This file was deleted.

2 changes: 0 additions & 2 deletions packages/fluentui/src/components/fButton/index.ts

This file was deleted.

2 changes: 0 additions & 2 deletions packages/fluentui/src/components/fCheckbox/index.ts

This file was deleted.

Loading

0 comments on commit e8769f4

Please sign in to comment.